Examples of MemoryContext


Examples of org.jboss.virtual.plugins.context.memory.MemoryContext

public class Handler extends URLStreamHandler
{
   protected URLConnection openConnection(URL u) throws IOException
   {
      String host = u.getHost();
      MemoryContext ctx = MemoryContextFactory.getInstance().find(host);
      if (ctx == null)
         throw new IOException("vfs does not exist: " + u.toString());

      VirtualFile vf = ctx.findChild(ctx.getRoot(), u.getPath()).getVirtualFile();
      if (vf == null)
         throw new IOException("vfs does not exist: " + u.toString());

      return new VirtualFileURLConnection(u, vf);
   }
View Full Code Here

Examples of org.jboss.virtual.plugins.context.memory.MemoryContext

public class Handler extends URLStreamHandler
{
   protected URLConnection openConnection(URL u) throws IOException
   {
      String host = u.getHost();
      MemoryContext ctx = MemoryContextFactory.getInstance().find(host);
      if (ctx == null)
         throw new IOException("vfs does not exist: " + u.toString());

      VirtualFile vf = ctx.getChild(ctx.getRoot(), u.getPath()).getVirtualFile();
      if (vf == null)
         throw new IOException("vfs does not exist: " + u.toString());

      return new VirtualFileURLConnection(u, vf);
   }
View Full Code Here

Examples of org.jboss.virtual.plugins.context.memory.MemoryContext

public class Handler extends URLStreamHandler
{
   protected URLConnection openConnection(URL u) throws IOException
   {
      String host = u.getHost();
      MemoryContext ctx = MemoryContextFactory.getInstance().find(host);

      if (ctx == null) throw new IOException("vfs does not exist: " + u.toString());
      VirtualFile vf = ctx.findChild(ctx.getRoot(), u.getPath()).getVirtualFile();
      if (vf == null) throw new IOException("vfs does not exist: " + u.toString());
      return new VirtualFileURLConnection(u, vf);
     
   }
View Full Code Here

Examples of org.jboss.virtual.plugins.context.memory.MemoryContext

/*    */ {
/*    */   protected URLConnection openConnection(URL u)
/*    */     throws IOException
/*    */   {
/* 45 */     String host = u.getHost();
/* 46 */     MemoryContext ctx = MemoryContextFactory.getInstance().find(host);
/* 47 */     if (ctx == null) {
/* 48 */       throw new IOException("vfs does not exist: " + u.toString());
/*    */     }
/* 50 */     VirtualFile vf = ctx.findChild(ctx.getRoot(), u.getPath()).getVirtualFile();
/* 51 */     if (vf == null) {
/* 52 */       throw new IOException("vfs does not exist: " + u.toString());
/*    */     }
/* 54 */     return new VirtualFileURLConnection(u, vf);
/*    */   }
View Full Code Here

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

Examples of tyrex.naming.MemoryContext

            //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

Examples of tyrex.naming.MemoryContext

     * @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

Examples of tyrex.naming.MemoryContext

    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

Examples of tyrex.naming.MemoryContext

        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

Examples of tyrex.naming.MemoryContext

        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
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.