Package org.springframework.jndi

Examples of org.springframework.jndi.JndiTemplate.lookup()


       
        final JndiTemplate jndiTemplate = this.getJndiTemplate();

        // bind userId to /sessions context
        try {
            final Context sessionsContext = (Context) jndiTemplate.lookup("/sessions", Context.class);
           
            try {
                sessionsContext.bind(sessionId, userId);
            }
            catch (NameAlreadyBoundException nabe) {
View Full Code Here


        }

        final Context usersContext;
        try {
            // get /users context
            usersContext = (Context) jndiTemplate.lookup("/users", Context.class);
        }
        catch (NamingException ne) {
            final PortalException portalException = new PortalException("Could not find /users context", ne);
            this.logger.error(portalException.getMessage(), ne);
            throw portalException;
View Full Code Here


        final Context usersContext;
        try {
            // get /users context
            usersContext = (Context) jndiTemplate.lookup("/users", Context.class);
        }
        catch (NamingException ne) {
            final PortalException portalException = new PortalException("Could not find /users context", ne);
            this.logger.error(portalException.getMessage(), ne);
            throw portalException;
View Full Code Here

        }

        // obtain /sessions context
        final Context topSessionsContext;
        try {
            topSessionsContext = (Context) jndiTemplate.lookup("/sessions", Context.class);
        }
        catch (NamingException ne) {
            this.logger.warn("Could not get /sessions context. No JNDI context will be removed for sessionId='" + sessionId + "'", ne);
            return;
        }
View Full Code Here

    /* (non-Javadoc)
     * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
     */
    public void afterPropertiesSet() throws Exception {
        final JndiTemplate jndiTemplate = this.jndiManager.getJndiTemplate();
        this.servicesContext = (Context)jndiTemplate.lookup("/services", Context.class);
        this.svcHandler = new ServiceHandler();
       
       
        if (this.carResources.hasDescriptors()) {
            try {
View Full Code Here

            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);
   
View Full Code Here

            // 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);
View Full Code Here

            // 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>());
View Full Code Here

    private void lookupMessage() {
        JndiTemplate template = new JndiTemplate();

        try {
            message = (String) template.lookup(JndiDemoServlet.JNDI_NAME);
        } catch (NamingException ex) {
            message = ex.getMessage();
        }
    }
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.