Package org.apache.sandesha2.context

Examples of org.apache.sandesha2.context.ContextManager


            worker.setLock(getWorkerLock());
            worker.setWorkId(workId);
           
            // Wrap the invoker worker with the correct context, if needed.
            Runnable work = worker;
            ContextManager contextMgr = SandeshaUtil.getContextManager(context);
            if(contextMgr != null) {
              work = contextMgr.wrapWithContext(work, invoker.getContext());
            }
           
            threadPool.execute(work);
         
            //adding the workId to the lock after assigning it to a thread makes sure
View Full Code Here


        worker.setLock(getWorkerLock());
        worker.setWorkId(workId);
       
        // Wrap the invoker worker with the correct context, if needed.
        Runnable work = worker;
        ContextManager contextMgr = SandeshaUtil.getContextManager(context);
        if(contextMgr != null) {
          work = contextMgr.wrapWithContext(work, bean.getContext());
        }
        threadPool.execute(work);
       
        //adding the workId to the lock after assigning it to a thread makes sure
        //that all the workIds in the Lock are handled by threads.
View Full Code Here

      InvokerBeanMgr storageMapMgr = storageManager.getInvokerBeanMgr();

      storageManager.storeMessageContext(key, rmMsgCtx.getMessageContext());
      InvokerBean invokerBean = new InvokerBean(key, msgNo, sequenceId);
     
      ContextManager contextMgr = SandeshaUtil.getContextManager(configCtx);
      if(contextMgr != null) invokerBean.setContext(contextMgr.storeContext());

      storageMapMgr.insert(invokerBean);

      // This will avoid performing application processing more than once.
      rmMsgCtx.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE, "true");
View Full Code Here

      throw new SandeshaException(message,e);
    }
  }
 
  public static ContextManager getContextManager(ConfigurationContext context) throws SandeshaException {
    ContextManager mgr = null;
    AxisConfiguration config = context.getAxisConfiguration();
    Parameter p = config.getParameter(Sandesha2Constants.CONTEXT_MANAGER);
    if(p != null) mgr = (ContextManager) p.getValue();
    if (mgr != null) return mgr;
View Full Code Here

      throw new SandeshaException(message,e);
    }
  }
 
  public static ContextManager getContextManager(ConfigurationContext context) throws SandeshaException {
    ContextManager mgr = null;
    AxisConfiguration config = context.getAxisConfiguration();
    Parameter p = config.getParameter(Sandesha2Constants.CONTEXT_MANAGER);
    if(p != null) mgr = (ContextManager) p.getValue();
    if (mgr != null) return mgr;
View Full Code Here

    // it directly ourselves.
    InvokerWorker worker = null;
    if (SandeshaUtil.isInOrder(msgCtx)) {
      String key = SandeshaUtil.getUUID(); // key to store the message.
      InvokerBean invokerBean = new InvokerBean(key, msgNo, sequenceId);
      ContextManager contextMgr = SandeshaUtil.getContextManager(configCtx);

      if(contextMgr != null) invokerBean.setContext(contextMgr.storeContext());

      boolean wasAdded = storageManager.getInvokerBeanMgr().insert(invokerBean);

      // This will avoid performing application processing more than once.
      rmMsgCtx.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE, "true");
View Full Code Here

      throw new SandeshaException(message,e);
    }
  }
 
  public static ContextManager getContextManager(ConfigurationContext context) throws SandeshaException {
    ContextManager mgr = null;
    AxisConfiguration config = context.getAxisConfiguration();
    Parameter p = config.getParameter(Sandesha2Constants.CONTEXT_MANAGER);
    if(p != null) mgr = (ContextManager) p.getValue();
    if (mgr != null) return mgr;
View Full Code Here

            worker.setPooled();
            worker.setWorkId(workId);
           
            // Wrap the invoker worker with the correct context, if needed.
            Runnable work = worker;
            ContextManager contextMgr = SandeshaUtil.getContextManager(ctx);
            if(contextMgr != null) {
              work = contextMgr.wrapWithContext(work, invoker.getContext());
            }
           
            // Setup the lock for the new worker
            worker.getLock().addWork(workId, worker);
            ctx.getThreadPool().execute(work);
View Full Code Here

        worker.setPooled();
        worker.setWorkId(workId);
       
        // Wrap the invoker worker with the correct context, if needed.
        Runnable work = worker;
        ContextManager contextMgr = SandeshaUtil.getContextManager(context);
        if(contextMgr != null) {
          work = contextMgr.wrapWithContext(work, bean.getContext());
        }
        try {
          // Set the lock up before we start the thread, but roll it back
          // if we hit any problems
          if(worker.getLock().addWork(workId, worker))
View Full Code Here

                lastMessageInvoked = invokeMessage(theTran);
              }
            };

            // Wrap the work with the correct context, if needed.
            ContextManager contextMgr = SandeshaUtil.getContextManager(configurationContext);
            if(contextMgr != null) {
              work = contextMgr.wrapWithContext(work, nextBean.getContext());
            }

            // Finally do the work
            work.run();

            tran = null;
          } else {
            if(log.isDebugEnabled()) log.debug("InvokerWorker:: not pooled thread");
            nextWorker = new InvokerWorker(configurationContext, nextBean);
            nextWorker.setPooled();
            nextWorker.setWorkId(workId);

            // Wrap the invoker worker with the correct context, if needed.
            ContextManager contextMgr = SandeshaUtil.getContextManager(configurationContext);
            if(contextMgr != null) {
              nextRunnable = contextMgr.wrapWithContext(nextWorker, nextBean.getContext());
            } else {
              nextRunnable = nextWorker;
            }
          }
        }
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.context.ContextManager

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.