Examples of ClientInvoker


Examples of mx4j.remote.rmi.ClientInvoker

   public MBeanServerConnection getMBeanServerConnection(Subject delegate) throws IOException
   {
      if (!connected) throw new IOException("Connection has not been established");

      // TODO: here we hardcode the client invocation chain. Maybe worth remove this hardcoding ?
      ClientInvoker invoker = new ClientInvoker(connection, notificationHandler, delegate);
      MBeanServerConnection unmarshaller = ClientUnmarshaller.newInstance(invoker, defaultClassLoader);
      MBeanServerConnection catcher = ClientExceptionCatcher.newInstance(unmarshaller);

      return catcher;
   }
View Full Code Here

Examples of mx4j.remote.rmi.ClientInvoker

   public MBeanServerConnection getMBeanServerConnection(Subject delegate) throws IOException
   {
      if (!connected) throw new IOException("Connection has not been established");

      // TODO: here we hardcode the client invocation chain. Maybe worth remove this hardcoding ?
      ClientInvoker invoker = new ClientInvoker(connection, notificationHandler, delegate);
      MBeanServerConnection unmarshaller = ClientUnmarshaller.newInstance(invoker, defaultClassLoader);
      MBeanServerConnection catcher = ClientExceptionCatcher.newInstance(unmarshaller);

      return catcher;
   }
View Full Code Here

Examples of org.jboss.remoting.transport.ClientInvoker

   public static boolean checkConnection(InvokerLocator locator, Map config) throws Throwable
   {
      boolean pingWorked = false;
      Map configMap = createPingConfig(config, null);
      int pingTimeout = Integer.parseInt((String) configMap.get(ServerInvoker.TIMEOUT));
      ClientInvoker innerClientInvoker = null;

      try
      {
         innerClientInvoker = InvokerRegistry.createClientInvoker(locator, configMap);

         if (!innerClientInvoker.isConnected())
         {
            if (trace) { log.trace("inner client invoker not connected, connecting ..."); }
            innerClientInvoker.connect();
         }

         pingWorked = doCheckConnection(innerClientInvoker, pingTimeout);
      }
      catch (Throwable throwable)
      {
         log.debug("ConnectionValidator unable to connect to server " +
            innerClientInvoker.getLocator().getProtocol() + "://" +
            innerClientInvoker.getLocator().getHost() + ":" +
            innerClientInvoker.getLocator().getPort(), throwable);
      }
      finally
      {
         if (innerClientInvoker != null)
         {
View Full Code Here

Examples of org.jboss.remoting.transport.ClientInvoker

         getParametersFromMap(client.getInvoker().getLocator().getParameters());
      }
      getParametersFromMap(client.getConfiguration());
      getParametersFromMap(metadata);
     
      ClientInvoker clientInvoker = client.getInvoker();
      if (clientInvoker instanceof MicroRemoteClientInvoker)
      {
         sharedInvoker = (MicroRemoteClientInvoker) clientInvoker;
         invokerSessionId = sharedInvoker.getSessionId();
      }
View Full Code Here

Examples of org.jboss.remoting.transport.ClientInvoker

         if (trace)
         {
            log.trace("destroying client invoker " + locator + ", config " + configuration);
         }

         ClientInvoker invoker = decrementClientInvokerCounter(locator, configuration);

         if(invoker != null)
         {
            if (trace)
            {
               log.trace("disconnecting " + invoker);
            }
            invoker.disconnect();
            invoker = null;
         }
      }
   }
View Full Code Here

Examples of org.jboss.remoting.transport.ClientInvoker

      {
         throw new NullPointerException("locator cannot be null");
      }
      synchronized(clientLock)
      {
         ClientInvoker invoker = getRegisteredClientInvoker(locator, configuration);
         if(invoker != null)
         {
            if(trace) { log.trace("Found and returning cached client invoker (" + invoker + ")"); }
            return invoker;
         }

         boolean isForceRemote = false;
         boolean isPassByValue = false;
         Map parameters = locator.getParameters();
         if(parameters != null)
         {
            String value = (String) parameters.get(InvokerLocator.BYVALUE);
            if(value != null && Boolean.valueOf(value).booleanValue())
            {
               isPassByValue = true;
            }
            value = (String) parameters.get(InvokerLocator.FORCE_REMOTE);
            if(value != null && Boolean.valueOf(value).booleanValue())
            {
               isForceRemote = true;
            }
         }
         // configuration map will override locator params
         if(configuration != null)
         {
            String value = (String) configuration.get(InvokerLocator.BYVALUE);
            if(value != null && Boolean.valueOf(value).booleanValue())
            {
               isPassByValue = true;
            }
            value = (String) configuration.get(InvokerLocator.FORCE_REMOTE);
            if(value != null && Boolean.valueOf(value).booleanValue())
            {
               isForceRemote = true;
            }
         }

         // Check to see if server invoker is local
         // If in server locators map, then created locally by this class
         ServerInvoker svrInvoker = (ServerInvoker) serverLocators.get(locator);
         if(svrInvoker != null && !isForceRemote)
         {
            LocalClientInvoker localInvoker = new LocalClientInvoker(locator, configuration, isPassByValue);
            // have to set reference to local server invoker so client in invoke directly
            localInvoker.setServerInvoker(svrInvoker);
            invoker = localInvoker;
            InvokerLocator l = invoker.getLocator();

            addRegisteredClientInvoker(invoker, l, configuration);
         }
         else //not local
         {
            String protocol = locator.getProtocol();
            if(protocol == null)
            {
               throw new NullPointerException("protocol cannot be null for the locator");
            }

            invoker = loadClientInvoker(protocol, locator, configuration);

            InvokerLocator l = invoker.getLocator();

            addRegisteredClientInvoker(invoker, l, configuration);
         }
         return invoker;
      }
View Full Code Here

Examples of org.jboss.remoting.transport.ClientInvoker

    * @param locator
    * @param configuration
    */
   private static ClientInvoker getRegisteredClientInvoker(InvokerLocator locator, Map configuration)
   {
      ClientInvoker invoker = null;

      List holderList = (List) clientLocators.get(locator);
      if (holderList != null)
      {
         for (int x = 0; x < holderList.size(); x++)
View Full Code Here

Examples of org.jboss.remoting.transport.ClientInvoker

      holder.incrementCount();
   }

   private static ClientInvoker loadClientInvoker(String protocol, InvokerLocator locator, Map configuration) throws Exception
   {
      ClientInvoker clientInvoker = null;

      Class transportFactoryClass = getTransportClientFactory(protocol);
      if(transportFactoryClass != null)
      {
         ClientFactory transportFactory = (ClientFactory)transportFactoryClass.newInstance();
View Full Code Here

Examples of org.jboss.remoting.transport.ClientInvoker

         log.debug("Could not decrement client invoker counter for locator " + locator +
                   "as does not exist in invoker registry with matching configuraion map.");
         return null;
      }

      ClientInvoker clientInvoker =  null;
      holder.decrementCount();

      if(holder.getCount() == 0)
      {
         clientInvoker = holder.getClientInvoker();
View Full Code Here

Examples of org.jboss.remoting.transport.ClientInvoker

     
      Client callbackClient1 = serverInvokerCallbackHandler1.getCallbackClient();
      Client callbackClient2 = serverInvokerCallbackHandler2.getCallbackClient();
      assertNotSame(callbackClient1, callbackClient2);
 
      ClientInvoker clientInvoker1 = callbackClient1.getInvoker();
      assertTrue(clientInvoker1 instanceof BisocketClientInvoker);
      ClientInvoker clientInvoker2 = callbackClient2.getInvoker();
      assertTrue(clientInvoker2 instanceof BisocketClientInvoker);
      assertNotSame(clientInvoker1, clientInvoker2);
     
      Field field = MicroSocketClientInvoker.class.getDeclaredField("pool");
      field.setAccessible(true);
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.