Package org.jboss.remoting

Examples of org.jboss.remoting.InvokerLocator


         {
            throw new RuntimeException("Can not set internal callback server port as configuration value (" + sPort + " is not a number.");
         }
      }

      return new InvokerLocator(transport, host, port, "callback", metadata);
   }
View Full Code Here


  
   public Object execute(MethodInvocation invocation) throws Throwable
   {
      RemotableFuture future = executor.execute(invocation);

      InvokerLocator locator = (InvokerLocator) invocation.getMetaData(InvokeRemoteInterceptor.REMOTING, InvokeRemoteInterceptor.INVOKER_LOCATOR);

      // this is a remote invocation so just stuff the future within the response
      if (locator != null)
      {
         setupRemoteFuture(invocation, future, locator);
View Full Code Here

      // Start server.
      whenToFail = 0;
      setupServer();
     
      // Create client.
      InvokerLocator clientLocator = new InvokerLocator(locatorURI);
      HashMap clientConfig = new HashMap();
      clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
      clientConfig.put("timeout", "2000");
      addExtraClientConfig(clientConfig);
      Client client = new Client(clientLocator, clientConfig);
View Full Code Here

      // Start server.
      whenToFail = 1;
      setupServer();
     
      // Create client.
      InvokerLocator clientLocator = new InvokerLocator(locatorURI);
      HashMap clientConfig = new HashMap();
      clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
      clientConfig.put("timeout", "2000");
      addExtraClientConfig(clientConfig);
      Client client = new Client(clientLocator, clientConfig);
View Full Code Here

      // Start server.
      whenToFail = 2;
      setupServer();
     
      // Create client.
      InvokerLocator clientLocator = new InvokerLocator(locatorURI);
      HashMap clientConfig = new HashMap();
      clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
      clientConfig.put("timeout", "2000");
      addExtraClientConfig(clientConfig);
      Client client = new Client(clientLocator, clientConfig);
View Full Code Here

      String metadata = System.getProperty("remoting.metadata");
      if (metadata != null)
      {
         locatorURI += "/?" + metadata;
      }
      serverLocator = new InvokerLocator(locatorURI);
      log.info("Starting remoting server with locator uri of: " + locatorURI);
      HashMap config = new HashMap();
      config.put(InvokerLocator.FORCE_REMOTE, "true");
      addExtraServerConfig(config);
      connector = new Connector(serverLocator, config);
View Full Code Here

         if (!serverPeer.isSupportsFailover())
         {
            this.supportsFailover = false;
         }
        
         InvokerLocator locator = new InvokerLocator(locatorURI);
        
         String protocol = locator.getProtocol();
        
         if (!disableRemotingChecks && (protocol.equals("bisocket") || protocol.equals("sslbisocket")))
         {        
           //Sanity check - If users are using the AS Service Binding Manager to provide the remoting connector
           //configuration, it is quite easy for them to end up using an old version depending on what version on
           //the AS they are running in - e.g. if they have forgotten to update it.
           //This can lead to subtle errors - therefore we do a sanity check by checking the existence of some properties
           //which should always be there
           Map params = locator.getParameters();          
          
           //The "compulsory" parameters
           boolean cont =
             checkParam(params, "marshaller", "org.jboss.jms.wireformat.JMSWireFormat") &&              
             checkParam(params, "unmarshaller", "org.jboss.jms.wireformat.JMSWireFormat") &&
             checkParam(params, "dataType", "jms") &&
             checkParam(params, "clientSocketClass", "org.jboss.jms.client.remoting.ClientSocketWrapper");

           if (!cont)
           {
             throw new IllegalArgumentException("Failed to deploy connection factory since remoting configuration seems incorrect.");                                            
           }

           String val = (String)params.get("clientLeasePeriod");   
           if (val != null)
           {
             int i = Integer.parseInt(val);
             if (i < 5000)
             {
               log.warn("Value of clientLeasePeriod at " + i + " seems low. Normal values are >= 5000");
             }
           }
          
           val = (String)params.get("JBM_clientMaxPoolSize")
           if (val != null)
           {
             int i = Integer.parseInt(val);
             if (i < 50)
             {
               log.warn("Value of JBM_clientMaxPoolSize at " + i + " seems low. Normal values are >= 50");
             }
           }
         }

         connectionFactoryManager = serverPeer.getConnectionFactoryManager();
         connectorManager = serverPeer.getConnectorManager();
         connectionManager = serverPeer.getConnectionManager();

         int refCount = connectorManager.registerConnector(connectorObjectName.getCanonicalName());

         long leasePeriod = (Long)JMXAccessor.getJMXAttributeOverSecurity(server, connectorObjectName, "LeasePeriod");

         // if leasePeriod <= 0, disable pinging altogether

         boolean enablePing = leasePeriod > 0;
        
         if (refCount == 1 && enablePing)
         {
            // install the connection listener that listens for failed connections           
            server.invoke(connectorObjectName, "addConnectionListener",
                  new Object[] {connectionManager},
                  new String[] {"org.jboss.remoting.ConnectionListener"});
         }
        
         // We use the MBean service name to uniquely identify the connection factory
        
         connectionFactoryManager.
            registerConnectionFactory(getServiceName().getCanonicalName(), clientID, jndiBindings,
                                      locatorURI, enablePing, prefetchSize, slowConsumers,
                                      defaultTempQueueFullSize, defaultTempQueuePageSize,                                     
                                      defaultTempQueueDownCacheSize, dupsOKBatchSize, supportsFailover, supportsLoadBalancing,
                                      loadBalancingFactory, strictTck, sendAcksAsync, enableOrderingGroup, defaultOrderingGroupName);              
        
         String info = "Connector " + locator.getProtocol() + "://" +
            locator.getHost() + ":" + locator.getPort();
                
         if (enablePing)
         {
            info += " has leasing enabled, lease period " + leasePeriod + " milliseconds";
         }
View Full Code Here

   }
  
   private boolean sanityCheckFactories(Collection factories) throws Exception
   {
     Iterator iter = factories.iterator();
     InvokerLocator prevLocator = null;
     while (iter.hasNext())
     {
       ClientConnectionFactoryDelegate fact = (ClientConnectionFactoryDelegate)iter.next();
      
       //Sanity check - the locator protocol and params MUST be the same on each node
       String locatorString = fact.getServerLocatorURI();
      
       InvokerLocator locator = new InvokerLocator(locatorString);
      
       if (prevLocator != null)
       {
         //Do checks
        
         if (!locator.getProtocol().equals(prevLocator.getProtocol()))
         {
           log.error("Protocol to be used for connection factory does not match protocol specified at other nodes in the cluster " +
                   locator.getProtocol() + ", " + prevLocator.getProtocol());
           return false;
         }
         Map prevParams = prevLocator.getParameters();
         Map params = locator.getParameters();
         if (prevParams.size() != params.size())
         {
           log.error("Locator for connection factory has different number of parameters");
           return false;
         }
View Full Code Here

      this(serverLocatorURI, clientPing, strictTck, null, sendAcksAsync);
   }
     
   public JMSRemotingConnection(String serverLocatorURI, boolean clientPing, boolean strictTck, ConsolidatedRemotingConnectionListener listener, boolean sendAcksAsync) throws Exception
   {
      serverLocator = new InvokerLocator(serverLocatorURI);
      this.clientPing = clientPing;
      this.strictTck = strictTck;
      this.sendAcksAsync = sendAcksAsync;
      this.remotingConnectionListener = listener;
     
View Full Code Here

      //We execute this on it's own client
      Client client;
     
      try
      {
         client = new Client(new InvokerLocator(serverLocatorURI), configuration);
         client.setSubsystem(ServerPeer.REMOTING_JMS_SUBSYSTEM);
         client.connect();
      }
      catch (Exception e)
      {
View Full Code Here

TOP

Related Classes of org.jboss.remoting.InvokerLocator

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.