This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[#|2011-01-05T13:48:24.084-0500|INFO|glassfish3.1|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=68;_ThreadName=AutoDeployer;|[AutoDeploy] Selecting file /Users/jfarcand/workspace/atmosphere/container/glassfish3/glassfish/domains/domain1/autodeploy/grizzly-websockets-chat-1.9.27.war for autodeployment.|#] | |
[#|2011-01-05T13:48:24.515-0500|INFO|glassfish3.1|org.hibernate.validator.util.Version|_ThreadID=68;_ThreadName=AutoDeployer;|Hibernate Validator 4.1.0.Final|#] | |
[#|2011-01-05T13:48:24.520-0500|INFO|glassfish3.1|org.hibernate.validator.engine.resolver.DefaultTraversableResolver|_ThreadID=68;_ThreadName=AutoDeployer;|Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.|#] | |
[#|2011-01-05T13:48:25.053-0500|INFO|glassfish3.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=68;_ThreadName=AutoDeployer;|WEB0671: Loading application [grizzly-websockets-chat-1.9.27] at [/grizzly-websockets-chat]|#] | |
[#|2011-01-05T13:48 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[#|2011-01-05T14:04:34.742-0500|SEVERE|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=85;_ThreadName=Thread-35;|java.io.IOException: Cannot bind to URL [rmi://192.168.2.1:8686/jmxrmi]: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: Exception creating connection to: 192.168.2.1; nested exception is: | |
java.net.SocketException: Cannot allocate memory] | |
at javax.management.remote.rmi.RMIConnectorServer.newIOException(RMIConnectorServer.java:804) | |
at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:417) | |
at org.glassfish.admin.mbeanserver.RMIConnectorStarter.start(RMIConnectorStarter.java:309) | |
at org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread.startConnector(JMXStartupService.java:243) | |
at org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread.run(JMXStartupService.java:283) | |
Caused by: javax.naming.CommunicationExceptio |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface SimpleAsyncHttpClient { | |
public Future<Response> upload(String uri, File file); | |
public Future<Response> upload(String uri, InputStream stream); | |
public Future<Response> upload(String uri, BodyGenerator bodyGenerator) ; | |
public Future<Response> upload(Request request, File file) ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configuring Apache Client | |
HttpParams params = new BasicHttpParams(); | |
params.setParameter(HttpProtocolParams.PROTOCOL_VERSION, | |
HttpVersion.HTTP_1_1); | |
params.setBooleanParameter(HttpProtocolParams.USE_EXPECT_CONTINUE, | |
false); | |
params.setBooleanParameter(HttpConnectionParams.STALE_CONNECTION_CHECK, | |
false); | |
params.setIntParameter(HttpConnectionParams.SOCKET_BUFFER_SIZE, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final static String getBaseUrl(URI uri) { | |
String url = uri.getScheme() + "://" + uri.getAuthority(); | |
int port = uri.getPort(); | |
if (port == -1) { | |
port = getPort(uri); | |
url += ":" + port; | |
} | |
return url; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SimpleAsyncHttpClient class API: | |
public Future<Response> post(BodyGenerator bodyGenerator) throws IOException ; | |
public Future<Response> post(BodyGenerator bodyGenerator, BodyConsumer bodyConsumer) throws IOException ; | |
public Future<Response> put(BodyGenerator bodyGenerator, BodyConsumer bodyConsumer) throws IOException ; | |
public Future<Response> put(BodyGenerator bodyGenerator) throws IOException ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.sonatype.addressbook; | |
import java.util.Collection; | |
import org.sonatype.addressbook.model.Person; | |
public interface AddressBook | |
{ | |
//POST |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Path("/services/{handler}") | |
public class ServerHandler { | |
@POST | |
public Response service(@Context Request request, @ServiceHandler(POST, "createPerson(entity)") ServiceHandler serviceHandler){ | |
return serviceHandler.delegate(request); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Path("/service/:type") | |
@Produces({APPLICATION_JSON, APPLICATION_XML}) | |
@Consumes({APPLICATION_JSON, APPLICATION_XML}) | |
public class ServiceDescriptionResource { | |
@Inject | |
ServiceEntity delegate; | |
@POST |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Service Definition | |
ServiceDefinition serviceDefinition = injector.getInstance(ServiceDefinition.class); | |
serviceDefinition | |
.producing(ServiceDefinition.Media.JSON) | |
.producing(ServiceDefinition.Media.XML) | |
.consuming(ServiceDefinition.Media.JSON) | |
.consuming(ServiceDefinition.Media.XML) | |
.withHandler(new ServiceHandler(ServiceDefinition.HttpMethod.PUT, "id", "createAddressBook")) | |
.withHandler(new ServiceHandler(ServiceDefinition.HttpMethod.GET, "id", "getAddressBook")) |