Examples of JndiTemplate


Examples of org.springframework.jndi.JndiTemplate

   
    /**
     * Sets up the base sub contexts in the portal JNDI context.
     */
    protected void initializePortalContext() throws NamingException {
        final JndiTemplate jndiTemplate = this.getJndiTemplate();

        // Create a subcontext for portal-wide services, initialize services
        // Start any portal services configured in services.xml
        jndiTemplate.execute(new CreateSubContextCallback("services"));

        // Create a subcontext for user specific bindings
        jndiTemplate.execute(new CreateSubContextCallback("users"));

        // Create a subcontext for session listings
        jndiTemplate.execute(new CreateSubContextCallback("sessions"));

        this.logger.info("Initialized portal JNDI context");
    }
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

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

Examples of org.springframework.jndi.JndiTemplate

     * @param layoutId id of the layout used by the user
     * @return a channel <code>InitialContext</code> value
     */
    private Context getChannelJndiContext(String sessionId, String userId, String layoutId) {
        final IJndiManager jndiManager = JndiManagerLocator.getJndiManager();
        final JndiTemplate jndiTemplate = jndiManager.getJndiTemplate();
       
        final Thread currentThread = Thread.currentThread();
        final ClassLoader contextClassLoader = currentThread.getContextClassLoader();
        try {
            //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>());
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

  private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
    // Rely on default serialization; just initialize state after deserialization.
    ois.defaultReadObject();

    // Create template for client-side JNDI lookup.
    this.jndiTemplate = new JndiTemplate();

    // Perform a fresh lookup for JTA handles.
    initUserTransactionAndTransactionManager();
    initTransactionSynchronizationRegistry();
  }
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

  private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
    // Rely on default serialization; just initialize state after deserialization.
    ois.defaultReadObject();

    // Create template for client-side JNDI lookup.
    this.jndiTemplate = new JndiTemplate();

    // Perform a fresh lookup for JTA handles.
    initUserTransactionAndTransactionManager();
    initTransactionSynchronizationRegistry();
  }
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

  private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
    // Rely on default serialization; just initialize state after deserialization.
    ois.defaultReadObject();

    // Create template for client-side JNDI lookup.
    this.jndiTemplate = new JndiTemplate();

    // Perform a fresh lookup for JTA handles.
    initUserTransactionAndTransactionManager();
    initTransactionSynchronizationRegistry();
  }
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
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.