Package org.jboss.remoting.invocation

Examples of org.jboss.remoting.invocation.NameBasedInvocation


      return transport;
   }
  
   protected Object makeInvocation(String method, String param) throws Throwable
   {
      Object ret = client.invoke(new NameBasedInvocation(method,
            new Object[]{param},
            new String[]{String.class.getName()}),
            null);
     
      return ret;
View Full Code Here


      return ret;
   }
  
   protected Object solicitCallback(String param) throws Throwable
   {
      Object ret = client.invoke(new NameBasedInvocation("test",
            new Object[]{param},
            new String[]{String.class.getName()}),
            null);
     
      return ret;
View Full Code Here

   public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
   {
      String methodName = method.getName();
      String[] paramSig = createParamSignature(method.getParameterTypes());

      NameBasedInvocation request = new NameBasedInvocation(methodName,
                                                            args,
                                                            paramSig);
      Object response = null;

      boolean failOver = false;
View Full Code Here

   public Object invoke(InvocationRequest invocation) throws Throwable
   {
      Object request = invocation.getParameter();

      // Am expecting a NameBasedInvocation as the parameter
      NameBasedInvocation nbInvocation = (NameBasedInvocation) request;

      String methodName = nbInvocation.getMethodName();
      Object[] params = nbInvocation.getParameters();
      String[] sig = nbInvocation.getSignature();
      Class[] classSig = new Class[sig.length];
      for(int x = 0; x < sig.length; x++)
      {
         Class signature = getPrimitiveType(sig[x]);
         if(signature != null)
View Full Code Here

        long time = System.currentTimeMillis();

        try {
            InitialContext ic = new InitialContext();

            NameBasedInvocation nbi = ((NameBasedInvocation) invocationRequest.getParameter());
            if (null == nbi) {
                throw new IllegalArgumentException("InvocationRequest did not supply method.");
            }

            methodName = nbi.getMethodName();
            String[] methodInfo = methodName.split(":");
            Class<?> remoteClass = getClass(methodInfo[0]);

            String[] signature = nbi.getSignature();
            int signatureLength = signature.length;
            Class<?>[] sig = new Class[signatureLength];
            for (int i = 0; i < signatureLength; i++) {
                sig[i] = getClass(signature[i]);
            }

            // make sure the remote method is defined to ensure remote clients don't access locals
            String jndiName = getRemoteJNDIName(remoteClass);
            Object target = ic.lookup(jndiName);
            Method m = target.getClass().getMethod(methodInfo[1], sig);

            // switch to the local
            jndiName = getLocalJNDIName(remoteClass);
            target = ic.lookup(jndiName);

            m = target.getClass().getMethod(methodInfo[1], sig);
            result = m.invoke(target, nbi.getParameters());
            successful = true;

        } catch (InvocationTargetException e) {
            log.error("Failed to invoke remote request", e);
            return new WrappedRemotingException(e.getTargetException());
View Full Code Here

        AgentVersion version = getAgentVersion();
        ConnectAgentRequest request = new ConnectAgentRequest(agentName, version, agentUpdateEnabled);

        RemotePojoInvocationCommand connectCommand = new RemotePojoInvocationCommand();
        Method connectMethod = CoreServerService.class.getMethod("connectAgent", ConnectAgentRequest.class);
        NameBasedInvocation inv = new NameBasedInvocation(connectMethod, new Object[] { request });
        connectCommand.setNameBasedInvocation(inv);
        connectCommand.setTargetInterfaceName(CoreServerService.class.getName());
        return connectCommand;
    }
View Full Code Here

         * @see java.lang.reflect.InvocationHandler#invoke(Object, Method, Object[])
         */
        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
            String methodName = method.getName();
            String[] paramSig = createParamSignature(method.getParameterTypes());
            NameBasedInvocation invocation = new NameBasedInvocation(methodName, args, paramSig);
            RemotePojoInvocationCommandResponse response = null;
            Throwable throwable = null;

            RemotePojoInvocationCommand cmd = new RemotePojoInvocationCommand();
            cmd.setNameBasedInvocation(invocation);
View Full Code Here

     *
     * @see CommandExecutor#execute(Command, java.io.InputStream, java.io.OutputStream)
     */
    public CommandResponse execute(Command command, InputStream in, OutputStream out) {
        RemotePojoInvocationCommand remote_pojo_command = new RemotePojoInvocationCommand(command);
        NameBasedInvocation invocation = remote_pojo_command.getNameBasedInvocation();
        String target_interface_name = remote_pojo_command.getTargetInterfaceName();
        String method_name = invocation.getMethodName();
        Object[] params = invocation.getParameters();
        String[] signature = invocation.getSignature();
        Class<?>[] class_signature = new Class[signature.length];

        Permit permit = null;
        Method pojo_method = null;

View Full Code Here

     *
     * @see CommandExecutor#execute(Command, InputStream, OutputStream)
     */
    public CommandResponse execute(Command command, InputStream in, OutputStream out) {
        RemoteInputStreamCommand remote_command = new RemoteInputStreamCommand(command);
        NameBasedInvocation invocation = remote_command.getNameBasedInvocation();
        String method_name = invocation.getMethodName();
        Object[] params = invocation.getParameters();
        String[] signature = invocation.getSignature();
        Class<?>[] class_signature = new Class[signature.length];

        RemoteInputStreamCommandResponse response;

        try {
View Full Code Here

     *
     * @see CommandExecutor#execute(Command, InputStream, OutputStream)
     */
    public CommandResponse execute(Command command, InputStream in, OutputStream out) {
        RemoteOutputStreamCommand remote_command = new RemoteOutputStreamCommand(command);
        NameBasedInvocation invocation = remote_command.getNameBasedInvocation();
        String method_name = invocation.getMethodName();
        Object[] params = invocation.getParameters();
        String[] signature = invocation.getSignature();
        Class<?>[] class_signature = new Class[signature.length];

        RemoteOutputStreamCommandResponse response;

        try {
View Full Code Here

TOP

Related Classes of org.jboss.remoting.invocation.NameBasedInvocation

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.