Examples of SessionContext


Examples of bear.core.SessionContext

        return runSession(taskSession, null);
    }

    public <I, O extends TaskResult<?>> O runSession(Task<I, O> taskSession, I input) {
        {
            SessionContext taskCtx = taskSession.$();
            boolean sameContexts = taskCtx == null || taskCtx == $;
            Preconditions.checkArgument(sameContexts, "" +
                "contexts are different for task sessions: %s vs %s", taskCtx == null ? null : taskCtx.getName(), ($ == null ? null : $.getName()));
        }

        TaskResult<?> result = TaskResult.OK;

        // todo this line was added for dep checks and might be needed
View Full Code Here

Examples of br.gov.frameworkdemoiselle.context.SessionContext

    Collections.sort(processors);
    Exception failure = null;
   
    RequestContext tempRequestContext = Beans.getReference(RequestContext.class);
    SessionContext tempSessionContext = Beans.getReference(SessionContext.class);
    ViewContext tempViewContext = Beans.getReference(ViewContext.class);
    ConversationContext tempConversationContext = Beans.getReference(ConversationContext.class);

    boolean requestActivatedHere = !tempRequestContext.isActive();
    boolean sessionActivatedHere = !tempSessionContext.isActive();
    boolean viewActivatedHere = !tempViewContext.isActive();
    boolean conversationActivatedHere = !tempConversationContext.isActive();
   
    if (!registered) {
      if (!tempRequestContext.isActive())
        tempRequestContext.activate();
     
      if (!tempSessionContext.isActive())
        tempSessionContext.activate();
     
      if (!tempViewContext.isActive())
        tempViewContext.activate();
     
      if (!tempConversationContext.isActive())
        tempConversationContext.activate();

      registered = true;
    }

    for (Iterator<AnnotatedMethodProcessor> iter = processors.iterator(); iter.hasNext();) {
      AnnotatedMethodProcessor<?> processor = iter.next();

      try {
        ClassLoader classLoader = Reflections.getClassLoaderForClass(processor.getAnnotatedMethod()
            .getDeclaringType().getJavaClass().getCanonicalName());

        if (Thread.currentThread().getContextClassLoader().equals(classLoader)) {
          processor.process();
          iter.remove();
        }

      } catch (Exception cause) {
        failure = cause;
      }
    }

    if (processors.isEmpty()) {
      if (requestActivatedHere){
        tempRequestContext.deactivate();
      }
     
      if (sessionActivatedHere){
        tempSessionContext.deactivate();
      }
     
      if (viewActivatedHere){
        tempViewContext.deactivate();
      }
View Full Code Here

Examples of com.exedosoft.plat.SessionContext

*/
public class SuiteBottom implements DOIView {

  public String getHtmlCode(DOIModel aModel) {
   
    SessionContext us = DOGlobals.getInstance().getSessoinContext();
    String readonly = null;
    if(us!=null && us.getUser()!=null){
      readonly = us.getUser().getValue("readonly");
    }
   
   
   

View Full Code Here

Examples of com.taobao.metamorphosis.server.network.SessionContext

    }


    @Test
    public void testBeginPutCommitOnePhase() throws Exception {
        final SessionContext context = new SessionContextImpl("test", this.conn);
        final TransactionId xid = new LocalTransactionId("test", 100);
        assertNull(context.getTransactions().get(xid));
        this.processor.beginTransaction(context, xid, 0);
        final Transaction tx = context.getTransactions().get(xid);
        assertNotNull(tx);
        assertSame(xid, tx.getTransactionId());
        this.replay();

        this.processor.processPutCommand(new PutCommand("topic1", 2, "hello".getBytes(), xid, 0, 1), context, null);
        final MessageStore store = this.messageStoreManager.getOrCreateMessageStore("topic1", 2);
        store.flush();
        assertEquals(0, store.getSizeInBytes());

        // commit one phase
        this.processor.commitTransaction(context, xid, true);
        store.flush();
        assertEquals(Transaction.FINISHED_STATE, tx.getState());
        assertNull(context.getTransactions().get(xid));

        assertTrue(store.getSizeInBytes() > 0);
    }
View Full Code Here

Examples of de.xore.util.SessionContext

  }

  @Override
  protected Template handleRequest( @NotNull HttpServletRequest request, @NotNull HttpServletResponse response, @NotNull Context ctx ) throws Exception {
    HttpSession session = request.getSession();
    SessionContext sessionContext = getSessionContext( session );
    refreshSessionContext( sessionContext );
    checkSecurity( sessionContext );

    ctx.put( SESSION_CONTEXT, sessionContext );
    ctx.remove( FORMATTER );
    ctx.put( FORMATTER, new XoreVelocityFormatter( ctx, request, response, sessionContext ) );
    try {
      //Diese Methode wird in der Sub-Klasse implementiert.
      handle( request, response, ctx, session, sessionContext );
    } catch ( XoreException e ) {
      postProcessingContext( request, response, ctx );
      ctx.put( EXCEPTION, e );
      ctx.put( CONTENT_TEMPLATE_NAME, "error.vm" );
      return getLayoutTemplate();
    }

    ctx.put( CONTENT_TEMPLATE_NAME, getContentTemplateName( request ) );
    postProcessingContext( request, response, ctx );

    if ( redirectUrl( request ) ) {
      response.sendRedirect( response.encodeRedirectURL( sessionContext.getRoot() + '/' + getRedirectUrl( request ) ) );
    }
    return getLayoutTemplate();
  }
View Full Code Here

Examples of javax.ejb.SessionContext

            Operation originalOperation = callContext.getCurrentOperation();
            BaseContext.State[] originalAllowedStates = callContext.getCurrentAllowedStates();

            try {
                Context ctx = deploymentInfo.getJndiEnc();               
                SessionContext sessionContext;
                // This needs to be synchronized as this code is multi-threaded.
                // In between the lookup and the bind a bind may take place in another Thread.
                // This is a fix for GERONIMO-3444
                synchronized(this){
                    try {                   
View Full Code Here

Examples of javax.ejb.SessionContext

            Operation originalOperation = callContext.getCurrentOperation();
            BaseContext.State[] originalAllowedStates = callContext.getCurrentAllowedStates();

            try {
                Context ctx = deploymentInfo.getJndiEnc();               
                SessionContext sessionContext;
                // This needs to be synchronized as this code is multi-threaded.
                // In between the lookup and the bind a bind may take place in another Thread.
                // This is a fix for GERONIMO-3444
                synchronized(this){
                    try {                   
View Full Code Here

Examples of javax.ejb.SessionContext

            ThreadContext callContext = ThreadContext.getThreadContext();
            CoreDeploymentInfo deploymentInfo = callContext.getDeploymentInfo();
            Context ctx = deploymentInfo.getJndiEnc();

            // Get or create the session context
            SessionContext sessionContext;
            synchronized (this) {
                try {
                    sessionContext = (SessionContext) ctx.lookup("java:comp/EJBContext");
                } catch (NamingException e1) {
                    StatefulUserTransaction userTransaction = new StatefulUserTransaction(new EjbUserTransaction(), entityManagerRegistry);
View Full Code Here

Examples of javax.ejb.SessionContext

   private void checkSessionContext()
   {
      try
      {
         SessionContext other = (SessionContext) new InitialContext().lookup("java:comp/env/test");
         if(!other.equals(ctx))
            throw new RuntimeException("found wrong SessionContext at java:comp/env/test " + other + " != " + ctx);
      }
      catch(NamingException e)
      {
         log.error("failed to lookup java:comp/env/test", e);
View Full Code Here

Examples of javax.ejb.SessionContext

    public String sayHello(String user) {
        return this.commonBean.sayHello(user);
    }

    public Class<?> getInvokedBusinessInterface() {
        SessionContext sessionContext = (SessionContext) this.ejbContext;
        return sessionContext.getInvokedBusinessInterface();
    }
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.