Package javax.naming

Examples of javax.naming.InitialContext.lookup()


  public Vector getProjectStatusList()
  {
    Vector projectStatus = new Vector();
    try {
      InitialContext ic = CVUtility.getInitialContext();
      ProjectsHelperLocalHome home = (ProjectsHelperLocalHome)ic.lookup("local/ProjectsHelper");
      ProjectsHelperLocal remote = (ProjectsHelperLocal)home.create();
      remote.setDataSource(this.dataSource);
      projectStatus = remote.getProjectStatusList();
    } catch (Exception e) {
      System.out.println("[Exception][ProjectFacadeEJB.getProjectStatusList] Exception Thrown: "
View Full Code Here


      dl.executeUpdate();

      timeSlipId = dl.getAutoGeneratedKey();

            InitialContext ic = CVUtility.getInitialContext();
            AuthorizationLocalHome authorizationHome = (AuthorizationLocalHome)ic.lookup("local/Authorization");
            AuthorizationLocal authorizationLocal = authorizationHome.create();
            authorizationLocal.setDataSource(dataSource);
            authorizationLocal.saveCurrentDefaultPermission("Time Slips", timeSlipId, userId);
    }
    catch(Exception e)
View Full Code Here

  {
    ArrayList validFields = new ArrayList();
    try
    {
      InitialContext ic = CVUtility.getInitialContext();
      CustomFieldLocalHome home = (CustomFieldLocalHome)ic.lookup("local/CustomField");
      CustomFieldLocal remote = home.create();
      remote.setDataSource(this.dataSource);

      if (fieldType.equals("Both") || fieldType.equals("Individual"))
      {
View Full Code Here

    dqpCore.setTransactionService((TransactionService)LogManager.createLoggingProxy(LogConstants.CTX_TXN_LOG, transactionServerImpl, new Class[] {TransactionService.class}, MessageLevel.DETAIL));

    if (this.eventDistributorName != null) {
      try {
        InitialContext ic = new InitialContext();
        this.eventDistributor = (EventDistributor) ic.lookup(this.eventDistributorName);
      } catch (NamingException ne) {
        //log at a detail level since we may not be in the all profile
        LogManager.logDetail(LogConstants.CTX_RUNTIME, ne, IntegrationPlugin.Util.getString("jndi_failed", new Date(System.currentTimeMillis()).toString())); //$NON-NLS-1$
      }
    }
View Full Code Here

          ClassLoader originalContextClassLoader = Thread.currentThread().getContextClassLoader();
          try {
            // local connection
            if (providerURL == null) {
                  InitialContext ic  = new InitialContext();
                  return (ProfileService)ic.lookup(PROFILE_SERVICE_JNDI_NAME);
            }
           
            Properties env = new Properties();
            env.setProperty(Context.PROVIDER_URL, providerURL);
             
View Full Code Here

                env.setProperty(JNP_DISABLE_DISCOVERY_JNP_INIT_PROP, String.valueOf(JNP_DISABLE_DISCOVERY));
                env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); //$NON-NLS-1$ //$NON-NLS-2$
                InitialContext ic  = new InitialContext(env);
               
                try {
                  return (ProfileService)ic.lookup(PROFILE_SERVICE_JNDI_NAME);
                } catch(NamingException e) {
                  ProfileService ps =  (ProfileService)ic.lookup(SECURE_PROFILE_SERVICE_JNDI_NAME);
                  return (ProfileService)Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {ProfileService.class}, new JaasSecurityHandler(ps, this.userName, this.password));
                }
          } catch(NamingException e) {
View Full Code Here

                InitialContext ic  = new InitialContext(env);
               
                try {
                  return (ProfileService)ic.lookup(PROFILE_SERVICE_JNDI_NAME);
                } catch(NamingException e) {
                  ProfileService ps =  (ProfileService)ic.lookup(SECURE_PROFILE_SERVICE_JNDI_NAME);
                  return (ProfileService)Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {ProfileService.class}, new JaasSecurityHandler(ps, this.userName, this.password));
                }
          } catch(NamingException e) {
            throw new AdminComponentException(e);
          } finally {
View Full Code Here

 
  private Object getClusteredCache() {
    if (this.enabled && this.cacheManagerName != null) {
      try {
        Context ctx = new InitialContext();
        return ctx.lookup(this.cacheManagerName);
      } catch (NamingException e) {
        return null;
      }
    }
    return null;
View Full Code Here

        try {         
            // begin the transaction
            InitialContext ctx = new InitialContext();
            this.userTxn = (UserTransaction)ctx.lookup(jndi);
             this.userTxn.begin();
        } catch (Exception e) {
            throw new TransactionRuntimeException(e);
        }       
    }
View Full Code Here

    public Connection getConnection() throws QueryTestFailedException {
  validate();
  try {
      InitialContext ctx = new InitialContext();
      DataSource source = (DataSource) ctx.lookup(jndi_name);

      if (source == null) {
    String msg = "Unable to find jndi source " + jndi_name;//$NON-NLS-1$

    QueryTestFailedException mme = new QueryTestFailedException(msg);//$NON-NLS-1$
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.