Examples of InvocationException


Examples of org.crsh.cli.impl.invocation.InvocationException

        T command = null;
        try {
          command = commandInstance.get();
        }
        catch (Exception e) {
          throw new InvocationException(e);
        }

        //
        if (owner != null) {
          bind(match.owner(), owner.getParameters(), command, Util.EMPTY_ARGS);
        }

        // Prepare invocation
        Method m = getMethod();
        Class<?>[] parameterTypes = m.getParameterTypes();
        Object[] mArgs = new Object[parameterTypes.length];

        // Bind method parameter first
        bind(match, getParameters(), command, mArgs);

        // Fill missing contextual parameters and make primitive check
        for (int i = 0;i < mArgs.length;i++) {
          Class<?> parameterType = parameterTypes[i];
          if (mArgs[i] == null) {
            Object v = commandInstance.resolve(parameterType);
            if (v != null) {
              mArgs[i] = v;
            }
          }
          if (mArgs[i] == null && parameterType.isPrimitive()) {
            throw new SyntaxException("Method argument at position " + i + " of " + m + " is missing");
          }
        }

        // Perform method invocation
        try {
          Object ret = m.invoke(command, mArgs);
          return returnType.cast(ret);
        }
        catch (InvocationTargetException e) {
          Throwable t = e.getTargetException();
          if (t instanceof Error) {
            throw (Error)t;
          } else {
            throw new InvocationException(t);
          }
        }
        catch (IllegalAccessException t) {
          throw new InvocationException(t);
        }
      }
    };
  }
View Full Code Here

Examples of org.gatein.common.invocation.InvocationException

   {
      // Get the context of the portlet that the client want to use
      final PortletContext portletContext = invocation.getTarget();
      if (portletContext == null)
      {
         throw new InvocationException("No portlet context provided");
      }

      // Get the access mode
      InstanceContext instanceCtx = invocation.getInstanceContext();
      AccessMode access = instanceCtx.getAccessMode();
View Full Code Here

Examples of org.gatein.common.invocation.InvocationException

         phase = PortletRequest.RESOURCE_PHASE;
         chain = new FilterChainImpl<ResourceFilter>(resourceFilterList, ResourceFilter.class);
      }
      else
      {
        throw new InvocationException("Unexpected invocation " + invocation);
      }

      //
      try
      {
View Full Code Here

Examples of org.gatein.pc.api.invocation.InvocationException

   {
      // Get the context of the portlet that the client want to use
      final PortletContext portletContext = invocation.getTarget();
      if (portletContext == null)
      {
         throw new InvocationException("No portlet context provided");
      }

      // Get the access mode
      InstanceContext instanceCtx = invocation.getInstanceContext();
      AccessMode access = instanceCtx.getAccessMode();
View Full Code Here

Examples of org.gatein.pc.api.invocation.InvocationException

            return new ErrorResponse("Producer " + producerInfo.getId() + " doesn't support event processing.");
         }
      }
      else
      {
         throw new InvocationException("Unknown invocation type: " + invocation);
      }

      return handler.handle(invocation);
   }
View Full Code Here

Examples of org.gatein.pc.api.invocation.InvocationException

      {
         handler = actionHandler;
      }
      else
      {
         throw new InvocationException("Unknown invocation type: " + invocation);
      }

      return handler.handle(invocation);
   }
View Full Code Here

Examples of org.gatein.pc.api.invocation.InvocationException

            return new ErrorResponse("Producer " + producerInfo.getId() + " doesn't support event processing.");
         }
      }
      else
      {
         throw new InvocationException("Unknown invocation type: " + invocation);
      }

      // allow consumer delegate to pre-process the invocation before we actually invoke the handler
      final InvocationHandlerDelegate delegate = InvocationHandlerDelegate.consumerDelegate();
      if (delegate != null)
View Full Code Here

Examples of org.gatein.pc.api.invocation.InvocationException

   {
      // Get the context of the portlet that the client want to use
      final PortletContext portletContext = invocation.getTarget();
      if (portletContext == null)
      {
         throw new InvocationException("No portlet context provided");
      }

      // Get the access mode
      InstanceContext instanceCtx = invocation.getInstanceContext();
      AccessMode access = instanceCtx.getAccessMode();
View Full Code Here

Examples of org.gatein.pc.api.invocation.InvocationException

   {
      // Get the context of the portlet that the client want to use
      final PortletContext portletContext = invocation.getTarget();
      if (portletContext == null)
      {
         throw new InvocationException("No portlet context provided");
      }

      // Get the access mode
      InstanceContext instanceCtx = invocation.getInstanceContext();
      AccessMode access = instanceCtx.getAccessMode();
View Full Code Here

Examples of org.gatein.pc.api.invocation.InvocationException

         phase = PortletRequest.RESOURCE_PHASE;
         chain = new FilterChainImpl<ResourceFilter>(resourceFilterList, ResourceFilter.class);
      }
      else
      {
         throw new InvocationException("Unexpected invocation " + invocation);
      }

      //
      try
      {
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.