Package javax.naming

Examples of javax.naming.InitialContext.bind()


      ctx.rebind(DEFAULT_CACHE_POLICY_PATH, ref);
      log.debug("cachePolicyCtxPath="+cacheJndiName);

      // Bind the default SecurityProxyFactory instance under java:/SecurityProxyFactory
      SecurityProxyFactory proxyFactory = (SecurityProxyFactory) securityProxyFactoryClass.newInstance();
      ctx.bind("java:/SecurityProxyFactory", proxyFactory);
      log.debug("SecurityProxyFactory="+proxyFactory);
     
      //Handler custom callbackhandler
      if(callbackHandlerClass != JBossCallbackHandler.class)
      {
View Full Code Here


     
      //bind myself into JNDI, at java:/CounterService
      NonSerializableFactory.bind(JNDI_NAME, this);
      StringRefAddr addr = new StringRefAddr("nns", JNDI_NAME);
      Reference ref = new Reference(this.getClass().getName(), addr, NonSerializableFactory.class.getName(), null);
      ctx.bind(JNDI_NAME, ref);
   }
  
   protected void stopService() throws Exception
   {
      InitialContext ctx = new InitialContext();
View Full Code Here

      // Set up the authenticators in JNDI such that they can be configured for web apps
      InitialContext ic = new InitialContext();
      try
      {
         ic.bind("TomcatAuthenticators", tomcatDeployer.getAuthenticators());
      }
      catch (NamingException ne)
      {
         if (log.isTraceEnabled())
            log.trace("Binding Authenticators to JNDI failed", ne);
View Full Code Here

        environment.put(
                "java.naming.factory.initial",
                "org.osjava.sj.memory.MemoryContextFactory");
        environment.put("org.osjava.sj.jndi.shared", "true");
        InitialContext context = new InitialContext(environment);
        context.bind("repository", repository);

        // Test lookup with a traditional map of parameters
        Map<String, String> parameters = new HashMap<String, String>();
        parameters.put(
                "org.apache.jackrabbit.repository.jndi.name", "repository");
View Full Code Here

                    context.createSubcontext(contextName);
                }
            }

            // bind
            context.bind(jndiName, value);
            log.info("JavaMail session bound to " + jndiName);
        }
    }

    public void doStop() throws Exception {
View Full Code Here

         ctx = new InitialContext(new Hashtable(environment));
         boolean rebind = Boolean.valueOf((String)environment.get(RMIConnectorServer.JNDI_REBIND_ATTRIBUTE)).booleanValue();
         if (rebind)
            ctx.rebind(jndiURL, rmiServer.toStub());
         else
            ctx.bind(jndiURL, rmiServer.toStub());
         RmiConnectorActivator.log(LogService.LOG_DEBUG,"Bound " + rmiServer + " to " + jndiURL, null);
         return url;
      }
      catch (NamingException x)
      {
View Full Code Here

        NamingManager.setInitialContextFactoryBuilder(new MyInitialcontextFactoryBuilder());
        InitialContext ic = new InitialContext();
        EmbeddedDataSource ds = new EmbeddedDataSource();
        ds.setDatabaseName("target/test");
        ds.setCreateDatabase("create");
        ic.bind("osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/derbyds)", ds);
        PersonServiceImpl personService = new PersonServiceImpl();
        EntityManagerFactory emf = Persistence.createEntityManagerFactory("personTest", System.getProperties());
        EntityManager em = emf.createEntityManager();
        personService.setEntityManager(em);
        em.getTransaction().begin();
View Full Code Here

        NamingManager.setInitialContextFactoryBuilder(new MyInitialcontextFactoryBuilder());
        InitialContext ic = new InitialContext();
        EmbeddedDataSource ds = new EmbeddedDataSource();
        ds.setDatabaseName("target/test");
        ds.setCreateDatabase("create");
        ic.bind("osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/derbyds)", ds);
        PersonServiceImpl personService = new PersonServiceImpl();
        EntityManagerFactory emf = Persistence.createEntityManagerFactory("personTest", System.getProperties());
        EntityManager em = emf.createEntityManager();
        personService.setEntityManager(em);
        em.getTransaction().begin();
View Full Code Here

    ds.setUser("gis");
    ds.setPassword("gis");
    ds.setDefaultAutoCommit(true);
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY, MockIntialContextFactory.class.getName());
    InitialContext ic = new InitialContext();
    ic.bind("TAMTDataSource", ds);
  }
 
  @BeforeClass
  public static void runBeforeTests() throws Exception
  {
View Full Code Here

    ds.setUser("gis");
    ds.setPassword("gis");
    ds.setDefaultAutoCommit(true);
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY, MockIntialContextFactory.class.getName());
    InitialContext ic = new InitialContext();
    ic.bind("TAMTDataSource", ds);
  }
 
  @BeforeClass
  public static void runBeforeTests() throws Exception
  {
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.