Examples of SCPublishServerCallback


Examples of org.serviceconnector.api.srv.SCPublishServerCallback

      SCPublishServer publishSrv = sc.newPublishServer(serviceName);
      try {

        int maxSessions = 10;
        int maxConnections = 5;
        SCPublishServerCallback cbk = new SrvCallback(publishSrv);

        publishSrv.register(maxSessions, maxConnections, cbk);
      } catch (Exception e) {
        publishSrv.deregister();
        throw e;
View Full Code Here

Examples of org.serviceconnector.api.srv.SCPublishServerCallback

  @Test
  public void publish_100000_msg_compressed() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_TCP, TestConstants.PORT_PUB_SRV_TCP, ConnectionType.NETTY_TCP);
    server.startListener();
    publishServer = server.newPublishServer(TestConstants.pubServiceName1);
    SCPublishServerCallback cbk = new PubSrvCallback(publishServer);
    publishServer.register(10, 2, cbk);
    SCPublishMessage publishMessage = new SCPublishMessage(new byte[128]);
    publishMessage.setMask(TestConstants.mask);
    publishMessage.setCompressed(true);
    int nrMessages = 100000;
View Full Code Here

Examples of org.serviceconnector.api.srv.SCPublishServerCallback

  @Test
  public void publish_100000_msg_uncompressed() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_TCP, TestConstants.PORT_PUB_SRV_TCP, ConnectionType.NETTY_TCP);
    server.startListener();
    publishServer = server.newPublishServer(TestConstants.pubServiceName1);
    SCPublishServerCallback cbk = new PubSrvCallback(publishServer);
    publishServer.register(10, 2, cbk);
    SCPublishMessage publishMessage = new SCPublishMessage(new byte[128]);
    publishMessage.setMask(TestConstants.mask);
    publishMessage.setCompressed(false);
    int nrMessages = 100000;
View Full Code Here

Examples of org.serviceconnector.api.srv.SCPublishServerCallback

    SCSessionServerCallback cbk = new SrvSessionCallback(server);
    return cbk;
  }

  public SCPublishServerCallback newPublishSrvCallback(SCPublishServer server) {
    SCPublishServerCallback cbk = new SrvPublishCallback(server);
    return cbk;
  }
View Full Code Here

Examples of org.serviceconnector.api.srv.SCPublishServerCallback

    try {
      String serviceName = "cacheGuardian1";
      SCPublishServer server = sc.newPublishServer(serviceName);
      int maxSess = 100;
      int maxConn = 10;
      SCPublishServerCallback cbk = newPublishSrvCallback(server);
      try {
        server.register(maxSess, maxConn, cbk); // regular
        // server.registerServer(10, maxSess, maxConn, cbk); //
        // alternative with operation timeout
      } catch (Exception e) {
View Full Code Here

Examples of org.serviceconnector.api.srv.SCPublishServerCallback

      sc.startListener();

      String[] serviceNames = this.serviceNames.split(",");
      for (String serviceName : serviceNames) {
        SCPublishServer server = sc.newPublishServer(serviceName);
        SCPublishServerCallback cbk = new SrvCallback(server);
        try {
          server.register(10, this.maxSessions, this.maxConnections, cbk);
        } catch (Exception e) {
          LOGGER.error("runPublishServer", e);
          server.deregister();
View Full Code Here

Examples of org.serviceconnector.api.srv.SCPublishServerCallback

  @Test (expected = SCServiceException.class)
  public void t101_register() throws Exception {
    server = new SCServer(TestConstants.HOST, 9002, TestConstants.PORT_PUB_SRV_TCP, ConnectionType.NETTY_TCP);
    server.startListener();
    publishServer = server.newPublishServer(TestConstants.pubServiceName1);
    SCPublishServerCallback cbk = new PubSrvCallback(publishServer);
    publishServer.register(1, 1, cbk);
  }
View Full Code Here

Examples of org.serviceconnector.api.srv.SCPublishServerCallback

  @Test (expected = SCMPValidatorException.class)
  public void t102_register() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_TCP, TestConstants.PORT_PUB_SRV_TCP, ConnectionType.NETTY_TCP);
    server.startListener();
    publishServer = server.newPublishServer(null);
    SCPublishServerCallback cbk = new PubSrvCallback(publishServer);
    publishServer.register(1, 1, cbk);
  }
View Full Code Here

Examples of org.serviceconnector.api.srv.SCPublishServerCallback

  @Test (expected = SCServiceException.class)
  public void t103_register() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_TCP, TestConstants.PORT_PUB_SRV_TCP, ConnectionType.NETTY_TCP);
    server.startListener();
    publishServer = server.newPublishServer("");
    SCPublishServerCallback cbk = new PubSrvCallback(publishServer);
    publishServer.register(1, 1, cbk);
  }
View Full Code Here

Examples of org.serviceconnector.api.srv.SCPublishServerCallback

  @Test (expected = SCServiceException.class)
  public void t104_register() throws Exception {
    server = new SCServer(TestConstants.HOST, TestConstants.PORT_SC0_TCP, TestConstants.PORT_PUB_SRV_TCP, ConnectionType.NETTY_TCP);
    server.startListener();
    publishServer = server.newPublishServer(" ");
    SCPublishServerCallback cbk = new PubSrvCallback(publishServer);
    publishServer.register(1, 1, cbk);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.