Package org.jboss.remoting

Examples of org.jboss.remoting.ServerInvoker$CallbackContainer


    */
   public Detection createDetection()
   {
      Detection detection = null;

      ServerInvoker invokers[] = InvokerRegistry.getServerInvokers();
      if(invokers == null || invokers.length <= 0)
      {
         return detection;
      }
      List l = new ArrayList(invokers.length);
View Full Code Here


            it = new HashMap(virtualServerInvokers).values().iterator();
         }
        
         while (it.hasNext())
         {
            ServerInvoker serverInvoker = ((ServerInvoker) it.next());
            it.remove();
            serverInvoker.stop();
         }
      }
     
      if (socketGroupInfo != null)
      {
View Full Code Here

         InvokerLocator locator = new InvokerLocator(getTransport() + "://" + getHostName() + ":" + freeport);
         Connector connector = new Connector(locator, sconfig);
         connector.create();
        
         // Set ServerSocketFactory and SocketFactory in ServerInvoker.
         ServerInvoker serverInvoker = connector.getServerInvoker();
         ServerSocketFactory ssf1 = getDefaultServerSocketFactory();
         serverInvoker.setServerSocketFactory(ssf1);
         SocketFactory sf1 = getDefaultCallbackSocketFactory();
         serverInvoker.setSocketFactory(sf1);

         connector.addInvocationHandler("sample", new SampleInvocationHandler());
         connector.start();
        
        
         /////////////////////////////////////
         /////    Set up client side.     ////
         /////////////////////////////////////
         HashMap cconfig = new HashMap();

         // Make Client use remote invoker.
         cconfig.put(InvokerLocator.FORCE_REMOTE, "true");
 
         // Create Client.
         Client client = new Client(locator, cconfig);
         client.connect();
        
         // Set SocketFactory in ClientInvoker.
         SocketFactory sf2 = getDefaultSocketFactory();
         ClientInvoker clientInvoker = client.getInvoker();
         clientInvoker.setSocketFactory(sf2);

         System.out.println(getName() + ": " + client.invoke("test invoke()"));
        
        
         //////////////////////////////////////////////
         /////       Set up callback handling.     ////
         //////////////////////////////////////////////

         // Start callback Connector.
         freeport = PortUtil.findFreePort(getHostName());
         InvokerLocator callbackLocator = new InvokerLocator(getTransport() + "://" + getHostName() + ":" + freeport);
         Connector callbackConnector = new Connector(callbackLocator.getLocatorURI());
         callbackConnector.create();
         ServerInvoker callbackServerInvoker = callbackConnector.getServerInvoker();
         ServerSocketFactory ssf2 = getDefaultCallbackServerSocketFactory();
         callbackServerInvoker.setServerSocketFactory(ssf2);
         callbackConnector.addInvocationHandler("sample", new SampleInvocationHandler());
         callbackConnector.start();
        
         // Add callback handler.
         CallbackHandler callbackHandler = new CallbackHandler();
View Full Code Here

            if(log.isTraceEnabled())
            {
               log.trace("Error calling on " + serverInvoker + " because is in invalid state.  Will retry with new server invoker.");
            }

            ServerInvoker newServerInvoker = null;

            // try to get new server invoker if one exists
            ServerInvoker[] invokers = InvokerRegistry.getServerInvokers();
            if(invokers != null)
            {
               for(int x = 0; x < invokers.length; x++)
               {
                  ServerInvoker svrinvoker = invokers[x];
                  InvokerLocator svrlocator = svrinvoker.getLocator();
                  if(getLocator().equals(svrlocator))
                  {
                     newServerInvoker = svrinvoker;
                     break;
                  }
View Full Code Here

    */
   public Detection createDetection()
   {
      Detection detection = null;

      ServerInvoker invokers[] = InvokerRegistry.getServerInvokers();
      if(invokers == null || invokers.length <= 0)
      {
         return detection;
      }
      List l = new ArrayList(invokers.length);
View Full Code Here

      ServerInvoker[] serverInvokers = InvokerRegistry.getServerInvokers();
      if (serverInvokers != null && serverInvokers.length > 0)
      {
         for (int x = 0; x < serverInvokers.length; x++)
         {
            ServerInvoker svrInvoker = serverInvokers[x];
            InvokerLocator locator = svrInvoker.getLocator();
            if (locatorUrl.equalsIgnoreCase(locator.getLocatorURI()))
            {
               return (ServletServerInvokerMBean) svrInvoker;
            }
         }
View Full Code Here

    */
   public Detection createDetection()
   {
      Detection detection = null;

      ServerInvoker invokers[] = InvokerRegistry.getServerInvokers();
      if(invokers == null || invokers.length <= 0)
      {
         return detection;
      }
      List l = new ArrayList(invokers.length);
View Full Code Here

      ServerInvoker[] serverInvokers = InvokerRegistry.getServerInvokers();
      if (serverInvokers != null && serverInvokers.length > 0)
      {
         for (int x = 0; x < serverInvokers.length; x++)
         {
            ServerInvoker svrInvoker = serverInvokers[x];
            InvokerLocator locator = svrInvoker.getLocator();
            if (locatorUrl.equalsIgnoreCase(locator.getLocatorURI()))
            {
               return (ServletServerInvokerMBean) svrInvoker;
            }
         }
View Full Code Here

/*  744 */         it = new HashMap(this.virtualServerInvokers).values().iterator();
/*      */       }
/*      */
/*  747 */       while (it.hasNext())
/*      */       {
/*  749 */         ServerInvoker serverInvoker = (ServerInvoker)it.next();
/*  750 */         it.remove();
/*  751 */         serverInvoker.stop();
/*      */       }
/*      */     }
/*      */
/*  755 */     if (this.socketGroupInfo != null)
/*      */     {
View Full Code Here

/* 103 */       int freeport = PortUtil.findFreePort(getHostName());
/* 104 */       InvokerLocator locator = new InvokerLocator(getTransport() + "://" + getHostName() + ":" + freeport);
/* 105 */       Connector connector = new Connector(locator, sconfig);
/* 106 */       connector.create();
/*     */
/* 109 */       ServerInvoker serverInvoker = connector.getServerInvoker();
/* 110 */       ServerSocketFactory ssf1 = getDefaultServerSocketFactory();
/* 111 */       serverInvoker.setServerSocketFactory(ssf1);
/* 112 */       SocketFactory sf1 = getDefaultCallbackSocketFactory();
/* 113 */       serverInvoker.setSocketFactory(sf1);
/*     */
/* 115 */       connector.addInvocationHandler("sample", new SampleInvocationHandler());
/* 116 */       connector.start();
/*     */
/* 122 */       HashMap cconfig = new HashMap();
/*     */
/* 125 */       cconfig.put("force_remote", "true");
/*     */
/* 128 */       Client client = new Client(locator, cconfig);
/* 129 */       client.connect();
/*     */
/* 132 */       SocketFactory sf2 = getDefaultSocketFactory();
/* 133 */       ClientInvoker clientInvoker = client.getInvoker();
/* 134 */       clientInvoker.setSocketFactory(sf2);
/*     */
/* 136 */       System.out.println(getName() + ": " + client.invoke("test invoke()"));
/*     */
/* 144 */       freeport = PortUtil.findFreePort(getHostName());
/* 145 */       InvokerLocator callbackLocator = new InvokerLocator(getTransport() + "://" + getHostName() + ":" + freeport);
/* 146 */       Connector callbackConnector = new Connector(callbackLocator.getLocatorURI());
/* 147 */       callbackConnector.create();
/* 148 */       ServerInvoker callbackServerInvoker = callbackConnector.getServerInvoker();
/* 149 */       ServerSocketFactory ssf2 = getDefaultCallbackServerSocketFactory();
/* 150 */       callbackServerInvoker.setServerSocketFactory(ssf2);
/* 151 */       callbackConnector.addInvocationHandler("sample", new SampleInvocationHandler());
/* 152 */       callbackConnector.start();
/*     */
/* 155 */       CallbackHandler callbackHandler = new CallbackHandler();
/* 156 */       String callbackHandleObject = "myCallbackHandleObject";
View Full Code Here

TOP

Related Classes of org.jboss.remoting.ServerInvoker$CallbackContainer

Copyright © 2018 www.massapicom. 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.