Package org.jboss.invocation

Examples of org.jboss.invocation.Invocation


         return null;
      }
     
      protected void performThreadSafeCalls(int numberPairCalls, Class<? extends LoadBalancePolicy> policyClass) throws Exception
      {
         Invocation inv;
        
         for (int i = 0; i < numberPairCalls; i++)
         {
            /* create invocation to date time teller */
            inv = infrastructure.createDateTimeTellerInvocation(null, null, timeTellerProxy);
View Full Code Here


   }

   protected void performTransactionalStickyCalls(int numberPairCalls, Transaction tx,
         Class<? extends LoadBalancePolicy> policyClass, boolean newProxiesInBetweenTransactions) throws Exception
   {
      Invocation inv;
     
      Set<Object> chosenTargetsDateTimeTeller = new HashSet<Object>(1);
      Set<Object> chosenTargetsSystemTimeTeller = new HashSet<Object>(1);
     
      for (int i = 0; i < numberPairCalls; i++)
View Full Code Here

   }
  
   protected void performTransactionalCallsWithNodeShutdown(Transaction tx,
         Class<? extends LoadBalancePolicy> policyClass) throws Exception
   {
      Invocation inv;
     
      Set<Object> chosenTargetsDateTimeTeller = new HashSet<Object>(1);
     
      /* create invocation to date time teller */
      inv = infrastructure.createDateTimeTellerInvocation(tx, null, timeTellerProxy);
View Full Code Here

      }     
   }
  
   protected void failureCall(InvokerHaFailureType failureType, boolean injectFailureIn1stCall, Class<? extends LoadBalancePolicy> policyClass, boolean newProxiesInBetweenFailures) throws Exception
   {
      Invocation inv;
     
      if (injectFailureIn1stCall)
      {
         /* When failure must happen in the very 1st call, we create a 1st
          * invocation with the failure injected */
         inv = infrastructure.createDateTimeTellerInvocation(null, failureType, timeTellerProxy);        
      }
      else
      {
         /* When failure is not in first call, we do a call to each bean before
          * injecting the faliure */
         performTransactionalStickyCalls(1, null, policyClass, newProxiesInBetweenFailures);
         /* Now we create the invocation with the failure injected */
         inv = infrastructure.createDateTimeTellerInvocation(null, failureType, timeTellerProxy);
      }
     
      try
      {
         log.debug(invokeTimeTellerProxy(inv));
         if (failureType.isRecoverable(injectFailureIn1stCall))
         {
            failureType.assertFailoverCounter(injectFailureIn1stCall, inv.getAsIsValue("FAILOVER_COUNTER"));
            inv = infrastructure.createDateTimeTellerInvocation(null, null, timeTellerProxy);
            log.debug(invokeTimeTellerProxy(inv));
         }
         else
         {
            fail("should have failed, failover is not allowed for " + failureType);           
         }
      }
      catch (Exception e)
      {
         log.debug("Exception (could be expected) during failure call testing", e);
         if (failureType.isRecoverable(injectFailureIn1stCall))
         {
            fail("should have failed, failover is not allowed for " + failureType);
         }
         else
         {
            assertNull("transaction on the client side should be null", inv.getTransaction());
            failureType.assertFailoverCounter(injectFailureIn1stCall, inv.getAsIsValue("FAILOVER_COUNTER"));
            failureType.assertException(e.getCause());                       
         }
      }
   }
View Full Code Here

    * @param hashCode hashcode of object name of the mbean
    * @return
    */
   private Invocation createInvocation(Transaction tx, Integer hashCode, InvokerHaFailureType failureType, Invoker invoker)
   {
      Invocation inv = new Invocation();
      inv.setObjectName(hashCode);
      if (tx != null)
      {
         inv.setTransaction(tx);
      }
      if (failureType != null)
      {
         inv.setValue("FAILURE_TYPE", failureType);
      }

      InvocationContext ctx = new InvocationContext();
      ctx.setInvoker(invoker);
      inv.setInvocationContext(ctx);
     
      return inv;
   }
View Full Code Here

      }

      @Override
      public Object invoke(InvocationRequest invocationReq) throws Throwable
      {
         Invocation invocation = (Invocation) invocationReq.getParameter();
         InvokerHaFailureType failureType = (InvokerHaFailureType)invocation.getValue("FAILURE_TYPE");
         if (failureType != null)
         {
            failureType.injectFailureIfExistsAfterServer((Integer)invocation.getAsIsValue("FAILOVER_COUNTER"));
         }
        
         log.debug("invoking on " + invocation.getObjectName());
        
         return super.invoke(invocationReq);
      }
View Full Code Here

                  }
               }

               Object[] params = op.readParams(
                                  (org.omg.CORBA_2_3.portable.InputStream)in);
               Invocation inv = new Invocation(null,
                                               op.getMethod(),
                                               params,
                                               tx,
                                               principal, /* identity */
                                               password  /* credential*/);
               inv.setValue(InvocationKey.INVOKER_PROXY_BINDING,
                            "iiop",
                            PayloadKey.AS_IS);
               inv.setType(InvocationType.HOME);
              
               SecurityContext sc = SecurityContextFactory.createSecurityContext("CORBA_REMOTE");
               sc.getUtil().createSubjectInfo(principal, password, null);
               inv.setSecurityContext(sc);
              
               retVal = mbeanServer.invoke(containerName,
                                           "invoke",
                                           new Object[] {inv},
                                           Invocation.INVOKE_SIGNATURE);
View Full Code Here

            (SkeletonStrategy) methodInvokerMap.get(opName);
         if (op == null) {
            throw new BAD_OPERATION(opName);
         }
        
         Invocation inv = new Invocation(null,
                                         op.getMethod(),
                                         arguments,
                                         tx,
                                         null, /* identity */
                                         null  /* credential */);
         inv.setValue(InvocationKey.INVOKER_PROXY_BINDING,
                      "iiop",
                      PayloadKey.AS_IS);
         inv.setType(InvocationType.HOME);
         return mbeanServer.invoke(containerName,
                                   "invoke",
                                   new Object[] {inv},
                                   Invocation.INVOKE_SIGNATURE);
      }
View Full Code Here

                  }

               }
               Object[] params =
                  op.readParams((org.omg.CORBA_2_3.portable.InputStream) in);
               Invocation inv = new Invocation(id,
                  op.getMethod(),
                  params,
                  tx,
                  principal, /* identity */
                  password  /* credential */);
               inv.setValue(InvocationKey.INVOKER_PROXY_BINDING,
                  "iiop",
                  PayloadKey.AS_IS);
               inv.setType(InvocationType.REMOTE);

               SecurityContext sc = SecurityContextFactory.createSecurityContext("CORBA_REMOTE");
               sc.getUtil().createSubjectInfo(principal, password, null);
               inv.setSecurityContext(sc);

               retVal = mbeanServer.invoke(containerName,
                  "invoke",
                  new Object[]{inv},
                  Invocation.INVOKE_SIGNATURE);
View Full Code Here

         {
            logger.error("Error getting EJBObject id", e);
            throw new UnknownException(e);
         }

         Invocation inv = new Invocation(id,
            op.getMethod(),
            arguments,
            tx,
            null, /* identity */
            null  /* credential */);
         inv.setValue(InvocationKey.INVOKER_PROXY_BINDING,
            "iiop",
            PayloadKey.AS_IS);
         inv.setType(InvocationType.REMOTE);
         return mbeanServer.invoke(containerName,
            "invoke",
            new Object[]{inv},
            Invocation.INVOKE_SIGNATURE);
      }
View Full Code Here

TOP

Related Classes of org.jboss.invocation.Invocation

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.