import org.jboss.remoting3.Endpoint; import org.jboss.remoting3.Remoting; Endpoint endpoint = Remoting.createEndpoint("example", "localhost", 8080); endpoint.start(); endpoint.addConnectionProvider("default", new NioSocketBindingProvider(), false); endpoint.addService("example", new ExampleService()); import org.jboss.remoting3.Endpoint; import org.jboss.remoting3.Remoting; Endpoint endpoint = Remoting.createEndpoint("example-client"); endpoint.connect("localhost", 8080); Response response = endpoint.invoke(new ExampleRequest()); System.out.println("Response: " + response.getResult()); import org.jboss.remoting3.Endpoint; public interface ExampleService { void doSomething(); } public class ExampleServiceImpl implements ExampleService { @Override public void doSomething() { } } import org.jboss.remoting3.RemotingOptions; RemotingOptions.CONNECTION_POOL_SIZE.set(endpoint, 10); RemotingOptions.SERIALIZATION_TYPE.set(endpoint, "XML"); RemotingOptions.COMPRESSION.set(endpoint, true);


上一篇:
下一篇:
切换中文