Examples of JndiTemplate


Examples of org.springframework.jndi.JndiTemplate

     */
    public boolean init() {
        boolean result = initialized.compareAndSet(false, true);
        if (result) {
            if (jndiLocalTemplate == null) {
                jndiLocalTemplate = new JndiTemplate();
            }
            if (jndiOutboundTemplate == null) {
                jndiOutboundTemplate = new JndiTemplate();
            }
            if (inboundMessageConvertor == null) {
                inboundMessageConvertor = new SimpleJmsMessageConvertor();
            }
            if (outboundMessageConvertor == null) {
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

     */
    public boolean init() {
        boolean result = initialized.compareAndSet(false, true);
        if (result) {
            if (jndiLocalTemplate == null) {
                jndiLocalTemplate = new JndiTemplate();
            }
            if (jndiOutboundTemplate == null) {
                jndiOutboundTemplate = new JndiTemplate();
            }
            if (inboundMessageConvertor == null) {
                inboundMessageConvertor = new SimpleJmsMessageConvertor();
            }
            if (outboundMessageConvertor == null) {
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

   * Set the JNDI template to use for JNDI lookups.
   * You can also specify JNDI environment settings via "jndiEnvironment".
   * @see #setJndiEnvironment
   */
  public void setJndiTemplate(JndiTemplate jndiTemplate) {
    this.jndiTemplate = (jndiTemplate != null ? jndiTemplate : new JndiTemplate());
  }
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

   * Set the JNDI environment to use for JNDI lookups.
   * Creates a JndiTemplate with the given environment settings.
   * @see #setJndiTemplate
   */
  public void setJndiEnvironment(Properties jndiEnvironment) {
    this.jndiTemplate = new JndiTemplate(jndiEnvironment);
  }
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

        endpoint.setJndiInitialContextFactory("org.apache.activemq.jndi.ActiveMQInitialContextFactory");
        endpoint.setJndiURL("tcp://localhost:" + JMS_PORT);
        endpoint.setJndiConnectionFactoryName("ConnectionFactory");

        final JMSConfiguration jmsConfig = new JMSConfiguration();       
        JndiTemplate jt = new JndiTemplate();
       
        jt.setEnvironment(JMSOldConfigHolder.getInitialContextEnv(endpoint));
       
        JNDIConfiguration jndiConfig = new JNDIConfiguration();
        jndiConfig.setJndiConnectionFactoryName(endpoint.getJndiConnectionFactoryName());
        jmsConfig.setJndiTemplate(jt);
        jmsConfig.setJndiConfig(jndiConfig);
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

            int priority = endpoint.getPriority();
            jmsConfig.setPriority(priority);
        }

        if (jmsConfig.isUsingEndpointInfo()) {
            JndiTemplate jt = new JndiTemplate();
            jt.setEnvironment(JMSOldConfigHolder.getInitialContextEnv(endpoint));
            boolean pubSubDomain = endpoint.getJmsVariant().contains(JMSURIConstants.TOPIC);
            JNDIConfiguration jndiConfig = new JNDIConfiguration();
            jndiConfig.setJndiConnectionFactoryName(endpoint.getJndiConnectionFactoryName());
            jmsConfig.setJndiTemplate(jt);
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

        endpoint.setJndiInitialContextFactory("org.apache.activemq.jndi.ActiveMQInitialContextFactory");
        endpoint.setJndiURL("tcp://localhost:" + JMS_PORT);
        endpoint.setJndiConnectionFactoryName("ConnectionFactory");

        final JMSConfiguration jmsConfig = new JMSConfiguration();       
        JndiTemplate jt = new JndiTemplate();
       
        jt.setEnvironment(JMSOldConfigHolder.getInitialContextEnv(endpoint));
       
        JNDIConfiguration jndiConfig = new JNDIConfiguration();
        jndiConfig.setJndiConnectionFactoryName(endpoint.getJndiConnectionFactoryName());
        jmsConfig.setJndiTemplate(jt);
        jmsConfig.setJndiConfig(jndiConfig);
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

            long timeToLive = endpoint.getTimeToLive();
            jmsConfig.setTimeToLive(timeToLive);
        }

        if (jmsConfig.isUsingEndpointInfo()) {
            JndiTemplate jt = new JndiTemplate();
            jt.setEnvironment(JMSOldConfigHolder.getInitialContextEnv(endpoint));
            boolean pubSubDomain = false;
            pubSubDomain = endpoint.getJmsVariant().equals(JMSURIConstants.TOPIC);
            JNDIConfiguration jndiConfig = new JNDIConfiguration();
            jndiConfig.setJndiConnectionFactoryName(endpoint.getJndiConnectionFactoryName());
            jmsConfig.setJndiTemplate(jt);
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

     */
    public void initializeSessionContext(HttpSession session, String userId, String layoutId, Document userLayout) {
        final String sessionId = session.getId();
       
       
        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) {
                sessionsContext.rebind(sessionId, userId);
            }
        }
        catch (NamingException ne) {
            this.logger.warn("Unable to obtain /sessions context, no session data will be available in the context for sessionId='" + sessionId + "', userId='" + userId + "', and layoutId='" + layoutId + "'", ne);
        }

        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

Examples of org.springframework.jndi.JndiTemplate

    /* (non-Javadoc)
     * @see org.jasig.portal.jndi.IJndiManager#destroySessionContext(javax.servlet.http.HttpSession)
     */
    public void destroySessionContext(HttpSession session) {
        final JndiTemplate jndiTemplate = this.getJndiTemplate();
       
        final String sessionId = session.getId();


        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;
        }
       
        //No context, nothing to do
        if (usersContext == null) {
            this.logger.warn("No JNDI Context removed for sessionId='" + sessionId + "'");
            return;
        }

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