Package javax.naming

Examples of javax.naming.InitialContext


    passthrough = Boolean.valueOf(connectionProperties.getProperty(TeiidURL.CONNECTION.PASSTHROUGH_AUTHENTICATION, "false")); //$NON-NLS-1$
  }

  protected ClientServiceRegistry getClientServiceRegistry() {
    try {
      InitialContext ic = new InitialContext();
      return (ClientServiceRegistry)ic.lookup(TEIID_RUNTIME);
    } catch (NamingException e) {
      throw new TeiidRuntimeException(e);
    }
  }
View Full Code Here


        this.XADataSourceName = XADataSourceName;
    }

    private XADataSource getXADataSource() throws ResourceException {
        try {
            if (ic == null) ic = new InitialContext();
            XADataSource ds = (XADataSource) ic.lookup(XADataSourceName);
            return ds;
        } catch (Exception ex) {
            ResourceException rex = new ResourceException("");
            rex.setLinkedException(ex);
View Full Code Here

      if (server == null)
      {
         Hashtable jndiEnv = null;
         try
         {
            InitialContext iniCtx = new InitialContext();
            jndiEnv = iniCtx.getEnvironment();
            server = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
         }
         catch (NamingException ex)
         {
            throw new RuntimeException("Cannot obtain MBeanServerConnection using jndi props: " + jndiEnv, ex);
         }
View Full Code Here

   
    public JBossTransactionFactory() {
    }

    public TransactionManager getTransactionManager() {
        InitialContext ctx;
        try {
           ctx = new InitialContext();
        } catch (NamingException except) {
            throw new RuntimeException( "Can't create InitialContext", except);
        }
        try {
            return (TransactionManager) ctx.lookup(JNDI_LOOKUP_PATH);
        } catch (NamingException except) {
            throw new RuntimeException( "Error while looking up TransactionManager at " + JNDI_LOOKUP_PATH, except);
        }
    }
View Full Code Here

      this.datasource = datasource;
   }

   protected void initDatabase() throws Exception
   {
      DataSource ds = (DataSource)new InitialContext().lookup(datasource);
      Connection conn = ds.getConnection();
      boolean load = false;

      Statement st = conn.createStatement();
      ResultSet rs = null;
View Full Code Here

   public void executeSql(String resource, Connection conn)
   {
     UserTransaction tx =null;
     try
     {
       tx =  (UserTransaction)new InitialContext().lookup("UserTransaction");
       tx.begin();
      
       log.debug("Execute SQL from resource: "+resource);

       URL url = Thread.currentThread().getContextClassLoader().getResource(resource);
View Full Code Here

    }

  @SuppressWarnings("unchecked")
  public void clear() {
      try {
          UserTransaction ut = (UserTransaction) new InitialContext().lookup( "java:comp/UserTransaction" );
          ut.begin();
          List<ProcessInstanceLog> processInstances = getEntityManager()
        .createQuery("FROM ProcessInstanceLog").getResultList();
          for (ProcessInstanceLog processInstance: processInstances) {
            getEntityManager().remove(processInstance);
View Full Code Here

      //return new InitialContext();  /*** context initialized by jndi.properties file
        java.util.Properties p = new java.util.Properties();
        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
        p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
        p.put(Context.PROVIDER_URL, "localhost");
        return new InitialContext(p);
   }
View Full Code Here

      //return new InitialContext();  /*** context initialized by jndi.properties file
        java.util.Properties p = new java.util.Properties();
        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
        p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
        p.put(Context.PROVIDER_URL, "localhost");
        return new InitialContext(p);
   }
View Full Code Here

      //return new InitialContext();  /*** context initialized by jndi.properties file
        java.util.Properties p = new java.util.Properties();
        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
        p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
        p.put(Context.PROVIDER_URL, "localhost");
        return new InitialContext(p);
   }
View Full Code Here

TOP

Related Classes of javax.naming.InitialContext

Copyright © 2018 www.massapicom. 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.