Examples of JndiTemplate


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 lookup for JTA UserTransaction and TransactionManager.
    initUserTransactionAndTransactionManager();
  }
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

            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

  }

  private JmsTemplate createTemplate() {
    JmsTemplate template = new JmsTemplate();
    JndiDestinationResolver destMan = new JndiDestinationResolver();
    destMan.setJndiTemplate(new JndiTemplate() {
      protected Context createInitialContext() {
        return mockJndiContext;
      }
    });
    template.setDestinationResolver(destMan);
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

  }

  private JmsTemplate102 createTemplate() {
    JmsTemplate102 template = new JmsTemplate102();
    JndiDestinationResolver destMan = new JndiDestinationResolver();
    destMan.setJndiTemplate(new JndiTemplate() {
      protected Context createInitialContext() {
        return mockJndiContext;
      }
    });
    template.setDestinationResolver(destMan);
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

  }
 
  public void testLookupFailure() throws Exception {
    final NamingException nex = new NamingException();
    final String jndiName= "foobar";
    JndiTemplate jt = new JndiTemplate() {
      public Object lookup(String name) throws NamingException {
        assertTrue(jndiName.equals(name));
        throw nex;
      }
    };
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

  protected LocalSlsbInvokerInterceptor configuredInterceptor(MockControl contextControl, final String jndiName)
      throws Exception {

    final Context mockCtx = (Context) contextControl.getMock();
    LocalSlsbInvokerInterceptor si = new LocalSlsbInvokerInterceptor();
    si.setJndiTemplate(new JndiTemplate() {
      protected Context createInitialContext() throws NamingException {
        return mockCtx;
      }
    });
    si.setJndiName(jndiName);
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

    final MyHome home = (MyHome) mc.getMock();
    home.create();
    mc.setReturnValue(myEjb, 1);
    mc.replay();
   
    JndiTemplate jt = new JndiTemplate() {
      public Object lookup(String name) {
        // parameterize
        assertTrue(name.equals("java:comp/env/" + jndiName));
        return home;
      }
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

    final MyEjb myEjb = (MyEjb) ec.getMock();
    myEjb.getValue();
    ec.setReturnValue(value, 1);
    ec.replay();

    JndiTemplate jt = new JndiTemplate() {
      public Object lookup(String name) {
        // parameterize
        assertTrue(name.equals("java:comp/env/" + jndiName));
        return myEjb;
      }
View Full Code Here

Examples of org.springframework.jndi.JndiTemplate

    final MyHome home = (MyHome) mc.getMock();
    home.create();
    mc.setReturnValue(myEjb, 1);
    mc.replay();
 
    JndiTemplate jt = new JndiTemplate() {
      public Object lookup(String name) {
        // parameterize
        assertTrue(name.equals("java:comp/env/" + jndiName));
        return home;
      }
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.