Examples of LockableComponent


Examples of org.jboss.ejb3.concurrency.spi.LockableComponent

   protected abstract LockableComponent getLockableComponent();

   @AroundInvoke
   public Object invoke(InvocationContext invocationContext) throws Exception
   {
      LockableComponent lockableComponent = this.getLockableComponent();
      // get the invoked method
      Method invokedMethod = invocationContext.getMethod();
      if (invokedMethod == null)
      {
         throw new IllegalArgumentException("Invocation context: " + invocationContext + " cannot be processed because it's not applicable for a method invocation");
      }
      // get the Lock applicable for this method
      Lock lock = getLock(lockableComponent, invokedMethod);
      // the default access timeout (will be used in the absence of any explicit access timeout value for the invoked method)
      AccessTimeout defaultAccessTimeout = lockableComponent.getDefaultAccessTimeout();
      // set to the default values
      long time = defaultAccessTimeout.value();
      TimeUnit unit = defaultAccessTimeout.unit();

      AccessTimeout accessTimeoutOnMethod = lockableComponent.getAccessTimeout(invokedMethod);
      if (accessTimeoutOnMethod != null)
      {
         if (accessTimeoutOnMethod.value() < 0)
         {
            // for any negative value of timeout, we just default to max timeout val and max timeout unit.
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.