Examples of InvokerLocator


Examples of org.jboss.remoting.InvokerLocator

   public static Invocation injectRemotingInterceptors(Invocation invocation)
   {
      Invocation newInvocation = null;

      // Have to first get the locator from the invocation
      InvokerLocator locator = (InvokerLocator) invocation.getMetaData(REMOTING, INVOKER_LOCATOR);
      if (locator != null)
      {
         Interceptor[] newInterceptor = null;
         ArrayList interceptorList = new ArrayList();
View Full Code Here

Examples of org.jboss.remoting.InvokerLocator

    * @throws Exception
    */
   private Client getClient() throws Exception
   {
      String locatorURI = deployURI.toString();
      InvokerLocator locator = new InvokerLocator(locatorURI);
      log.debug("Calling remoting server with locator uri of: " + locatorURI);

      Client remotingClient = new Client(locator, REMOTING_SUBSYSTEM);
      remotingClient.connect();
      return remotingClient;
View Full Code Here

Examples of org.jboss.remoting.InvokerLocator

      return jndiName + PROXY_FACTORY_NAME;
   }
  
   protected Object createPojiProxy(Object oid, Class<?>[] interfaces, String uri) throws Exception
   {
      InvokerLocator locator = new InvokerLocator(uri);
      Interceptor[] interceptors = {IsLocalProxyFactoryInterceptor.singleton, InvokeRemoteInterceptor.singleton};
      PojiProxy proxy = new PojiProxy(oid, locator, interceptors);
      return Proxy.newProxyInstance(interfaces[0].getClassLoader(), interfaces, proxy);

   }
View Full Code Here

Examples of org.jboss.remoting.InvokerLocator

   public void start() throws Exception
   {
      this.init();
     
      InvokerLocator locator = this.getLocator();
      SessionContainer container = this.getContainer();
      partitionName = container.getPartitionName();
      proxyFamilyName = container.getDeploymentQualifiedName() + locator.getProtocol() + partitionName;
      partition = HAPartitionLocator.getHAPartitionLocator().getHAPartition(partitionName, container.getInitialContextProperties());
      drm = partition.getDistributedReplicantManager();
      hatarget = new HATarget(partition, proxyFamilyName, locator, HATarget.ENABLE_INVOCATIONS);
      ClusteringTargetsRepository.initTarget(proxyFamilyName, hatarget.getReplicants());
      container.getClusterFamilies().put(proxyFamilyName, hatarget);
View Full Code Here

Examples of org.jboss.remoting.InvokerLocator

   }
  
   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

Examples of org.jboss.remoting.InvokerLocator

         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,
                                      maxRetryChangeRate, retryChangeRateInterval, minTimeoutProcessTime);              
        
         String info = "Connector " + locator.getProtocol() + "://" +
            locator.getHost() + ":" + locator.getPort();
                
         if (enablePing)
         {
            info += " has leasing enabled, lease period " + leasePeriod + " milliseconds";
         }
View Full Code Here

Examples of org.jboss.remoting.InvokerLocator

      //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

Examples of org.jboss.remoting.InvokerLocator

   // no Sessions.  To be reworked in InvokableContextStatefulRemoteProxyInvocationHack,
   // as this implementation is @deprecated
   protected InvokableContext createRemoteProxyToContainer(String url)
   {
      // Create an InvokerLocator
      InvokerLocator locator = null;
      try
      {
         locator = new InvokerLocator(url);
      }
      catch (MalformedURLException e)
      {
         throw new RuntimeException("Could not create " + InvokerLocator.class.getSimpleName() + " to url \"" + url
               + "\"", e);
View Full Code Here

Examples of org.jboss.remoting.InvokerLocator

    * @return
    */
   protected InvokableContext createRemoteProxyToContainer(String url)
   {
      // Create an InvokerLocator
      InvokerLocator locator = null;
      try
      {
         locator = new InvokerLocator(url);
      }
      catch (MalformedURLException e)
      {
         throw new RuntimeException("Could not create " + InvokerLocator.class.getSimpleName() + " to url \"" + url
               + "\"", e);
View Full Code Here

Examples of org.jboss.remoting.InvokerLocator

            ProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_INVOKER_LOCATOR_URL);

      // Create an InvokerLocator
      assert url != null && !url.trim().equals("") : InvokerLocator.class.getSimpleName()
            + " URL is required, but is not specified; improperly bound reference in JNDI";
      InvokerLocator locator = new InvokerLocator(url);

      // Create a POJI Proxy to the Registrar
      Interceptor[] interceptors =
      {IsLocalProxyFactoryInterceptor.singleton, InvokeRemoteInterceptor.singleton};
      PojiProxy handler = new PojiProxy(proxyFactoryRegistryKey, locator, interceptors);
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.