Package tyrex.naming

Examples of tyrex.naming.MemoryContext


     * @see javax.naming.spi.InitialContextFactory#getInitialContext(java.util.Hashtable)
     */
    public Context getInitialContext(Hashtable<?, ?> environment) throws NamingException {
        synchronized (DisposableMemoryContextFactory.class) {
            if (context == null) {
                context = new MemoryContext(environment);
                LOGGER.info("Created new MemoryContext with environment '" + environment + "'");
            }
        }
       
        return context;
View Full Code Here


            //Switch to the portal classloader to ensure the JNDI lookup works
            final ClassLoader portalClassLoader = this.getClass().getClassLoader();
            currentThread.setContextClassLoader(portalClassLoader);
           
            // create a new InitialContext
            final Context cic = new MemoryContext(new Hashtable<Object, Object>());
            // get services context
            final Context servicesContext = (Context) jndiTemplate.lookup("services", Context.class);
            // get channel-ids context
            final Context channel_idsContext = (Context) jndiTemplate.lookup("users/" + userId + "/layouts/" + layoutId + "/channel-ids", Context.class);
            // get channel-obj context
            final Context channel_objContext = (Context) jndiTemplate.lookup("users/" + userId + "/sessions/" + sessionId + "/channel-obj", Context.class);
   
            cic.bind("services", servicesContext);
            cic.bind("channel-ids", channel_idsContext);
            cic.bind("channel-obj", channel_objContext);
            cic.bind("portlet-ids", new ArrayList<Object>());
   
            return cic;
        }
        catch (NamingException ne) {
            log.warn("Failed to create channel JNDI Context. No JNDI context will be available for inter-channel-communication.", ne);
View Full Code Here

     * @param layoutId id of the layout used by the user
     * @return a channel <code>InitialContext</code> value
     */
    private static Context getChannelJndiContext(Context portalContext,String sessionId,String userId,String layoutId) throws NamingException {
        // create a new InitialContext
        Context cic=new MemoryContext(new Hashtable());
        // get services context
        Context servicesContext=(Context)portalContext.lookup("services");
        // get channel-ids context
        Context channel_idsContext=(Context)portalContext.lookup("users/"+userId+"/layouts/"+layoutId+"/channel-ids");
        // get channel-obj context
        Context channel_objContext=(Context)portalContext.lookup("users/"+userId+"/sessions/"+sessionId+"/channel-obj");

        cic.bind("services",servicesContext);
        cic.bind("channel-ids",channel_idsContext);
        cic.bind("channel-obj",channel_objContext);
        cic.bind("portlet-ids",new ArrayList());

        return cic;
    }
View Full Code Here

    try
    {
      // Create the new context with the environment only once
      if(m_context == null)
      {
        m_context = new MemoryContext(environment);
      }
    }
    catch(Exception e)
    {
      e.printStackTrace();
View Full Code Here

        Context ctx = null;

        // Construct a non-shared memory context
        Hashtable env = new Hashtable();
        env.put(Context.INITIAL_CONTEXT_FACTORY, "tyrex.naming.MemoryContextFactory");
        rootJNDIContext = new MemoryContext(null);
        rootJNDIContext.createSubcontext("jdbc");
        ctx = rootJNDIContext.createSubcontext("comp");
        ctx = ctx.createSubcontext("env");
        ctx = ctx.createSubcontext("jdbc");
View Full Code Here

        Context ctx = null;

        // Construct a non-shared memory context
        Hashtable env = new Hashtable();
        env.put(Context.INITIAL_CONTEXT_FACTORY, "tyrex.naming.MemoryContextFactory");
        rootJNDIContext = new MemoryContext(null);
        rootJNDIContext.createSubcontext("jdbc");
        ctx = rootJNDIContext.createSubcontext("comp");
        ctx = ctx.createSubcontext("env");
        ctx = ctx.createSubcontext("jdbc");
View Full Code Here

        Context ctx = null;

        // Construct a non-shared memory context
        Hashtable env = new Hashtable();
        env.put(Context.INITIAL_CONTEXT_FACTORY, "tyrex.naming.MemoryContextFactory");
        rootJNDIContext = new MemoryContext(null);
        rootJNDIContext.createSubcontext("jdbc");
        ctx = rootJNDIContext.createSubcontext("comp");
        ctx = ctx.createSubcontext("env");
        ctx = ctx.createSubcontext("jdbc");
View Full Code Here

        Context ctx = null;

        // Construct a non-shared memory context
        Hashtable env = new Hashtable();
        env.put(Context.INITIAL_CONTEXT_FACTORY, "tyrex.naming.MemoryContextFactory");
        rootJNDIContext = new MemoryContext(null);
        rootJNDIContext.createSubcontext("jdbc");
        ctx = rootJNDIContext.createSubcontext("comp");
        ctx = ctx.createSubcontext("env");
        ctx = ctx.createSubcontext("jdbc");
View Full Code Here

TOP

Related Classes of tyrex.naming.MemoryContext

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.