Tabnine Logo
GlassfishNamingManager.getInitialContext
Code IndexAdd Tabnine to your IDE (free)

How to use
getInitialContext
method
in
org.glassfish.api.naming.GlassfishNamingManager

Best Java code snippets using org.glassfish.api.naming.GlassfishNamingManager.getInitialContext (Showing top 12 results out of 315)

origin: org.glassfish.main.core/kernel

public InitialContext getInitialContext() {
  GlassfishNamingManager gfNamingManager = 
    services.getService(GlassfishNamingManager.class);
  return (InitialContext)gfNamingManager.getInitialContext();
}
origin: org.glassfish.ejb/ejb-container

final UserTransaction getUserTransaction() {
  // Only session beans with bean-managed transactions
  // or message-driven beans with bean-managed transactions
  // can programmatically demarcate transactions.
  if ( (isSession || isMessageDriven) && isBeanManagedTran ) {
    try {
      UserTransaction utx = (UserTransaction)
      namingManager.getInitialContext().lookup(USER_TX);
      return utx;
    } catch ( Exception ex ) {
      _logger.log(Level.FINE, "ejb.user_transaction_exception", ex);
      throw new EJBException("Unable to lookup UserTransaction", ex);
    }
  }
  else
    throw new IllegalStateException(
      "ERROR: only SessionBeans with bean-managed transactions" + 
      "can obtain UserTransaction");
  
}

origin: org.glassfish.connectors/connectors-runtime

private void unbindConnectorDescriptor(String moduleName) throws ConnectorRuntimeException {
  if(ConnectorRuntime.getRuntime().isServer()){
    try {
      String descriptorJNDIName = ConnectorAdminServiceUtils.
          getReservePrefixedJNDINameForDescriptor(moduleName);
      _runtime.getNamingManager().getInitialContext().unbind(descriptorJNDIName);
      if(_logger.isLoggable(Level.FINEST)){
        _logger.finest("ResourceAdapterAdminServiceImpl :: destroyActiveRA "
          + moduleName + " removed descriptor " + descriptorJNDIName);
      }
    } catch (NamingException ne) {
      if(_logger.isLoggable(Level.FINEST)){
        _logger.log(Level.FINEST, "rardeployment.connector_descriptor_jndi_removal_failure", moduleName);
      }
    }
  }
}
origin: org.glassfish.main.ejb/ejb-container

final UserTransaction getUserTransaction() {
  // Only session beans with bean-managed transactions
  // or message-driven beans with bean-managed transactions
  // can programmatically demarcate transactions.
  if ( (container.isSession || container.isMessageDriven) && container.isBeanManagedTran ) {
    try {
      UserTransaction utx = (UserTransaction)
          container.namingManager.getInitialContext().lookup(USER_TX);
      return utx;
    } catch ( Exception ex ) {
      _logger.log(Level.FINE, "ejb.user_transaction_exception", ex);
      throw new EJBException(_logger.getResourceBundle().
          getString("ejb.user_transaction_exception"), ex);
    }
  }
  else {
    throw new IllegalStateException(localStrings.getLocalString(
      "ejb.ut_only_for_bmt",
      "Only session beans with bean-managed transactions can obtain UserTransaction"));
  }
}
origin: org.glassfish.main.ejb/ejb-full-container

private PersistentEJBTimerService(String ejbName, boolean removeOldTimers) throws Exception {
  super();
  timerLocal_ = (TimerLocal) ejbContainerUtil.getGlassfishNamingManager().
      getInitialContext().lookup(ejbName);
  this.removeOldTimers = removeOldTimers;
  initProperties();
  // Verify that the DataSource ref is correct and store it to check if connections can be aquired if
  // the timeout fails
  lookupTimerResource();
  // The default value for ReadDBBeforeTimeout in case of PE 
  // is false. 
  setPerformDBReadBeforeTimeout(!isDas);
}
origin: org.glassfish.connectors/connectors-runtime

/**
 * Returns a databaseName that is populated in pool's default DATABASENAME
 * @param poolInfo
 * @param mcf
 * @return
 * @throws javax.naming.NamingException if poolName lookup fails
 */
private String getDefaultDatabaseName(PoolInfo poolInfo, ManagedConnectionFactory mcf) 
    throws NamingException {
  // All this to get the default user name and principal
  String databaseName = null;
  ConnectorConnectionPool connectorConnectionPool = null;
  try {
    String jndiNameForPool = ConnectorAdminServiceUtils.getReservePrefixedJNDINameForPool(poolInfo);
    Context ic = _runtime.getNamingManager().getInitialContext();
    connectorConnectionPool = (ConnectorConnectionPool) ic.lookup(jndiNameForPool);
  } catch (NamingException ne) {
    throw ne;
  }
  databaseName = ccPoolAdmService.getPropertyValue("DATABASENAME", connectorConnectionPool);
  // To avoid using "" as the default databasename, try to get
  // the databasename from MCF. 
  if (databaseName == null || databaseName.trim().equals("")) {
    databaseName = ConnectionPoolObjectsUtils.getValueFromMCF("DatabaseName", poolInfo, mcf);
  }
  return databaseName;
}    
origin: org.glassfish.connectors/connectors-runtime

try {
  String jndiNameForPool = getReservePrefixedJNDINameForPool(poolInfo);
  Context ic = ConnectorRuntime.getRuntime().getNamingManager().getInitialContext();
  connectorConnectionPool =
      (ConnectorConnectionPool) ic.lookup(jndiNameForPool);
origin: org.glassfish.main.web/weld-integration

  javax.naming.Context ic = namingManager.getInitialContext();
  result = ic.lookup(envAnnotationName);
} else {
origin: org.glassfish.main.common/container-common

glassfishNamingManager.getInitialContext().lookup(lookupName);
origin: org.glassfish.connectors/connectors-internal-api

public Object lookup(GenericResourceInfo resourceInfo, String name, Hashtable env) throws NamingException{
  String applicationName = resourceInfo.getApplicationName();
  String moduleName = resourceInfo.getModuleName();
  moduleName = ConnectorsUtil.getActualModuleName(moduleName);
  if(!isGlobalName(resourceInfo.getName()) && applicationName != null && moduleName != null){
    return namingManager.lookupFromModuleNamespace(applicationName, moduleName, getModuleScopedName(name), env);
  }else if(!isGlobalName(resourceInfo.getName()) && applicationName != null) {
    if(pe.getProcessType().isServer() || pe.getProcessType().isEmbedded()){
      return namingManager.lookupFromAppNamespace(applicationName, getAppScopedName(name), env);
    }else{
      String internalGlobalJavaAppName =
          cnu.composeInternalGlobalJavaAppName(applicationName, getAppScopedName(name));
      if(_logger.isLoggable(Level.FINEST)){
        debug("appclient lookup : " + internalGlobalJavaAppName);
      }
      return namingManager.getInitialContext().lookup(internalGlobalJavaAppName);
    }
  }else{
    if(env != null){
      InitialContext ic = new InitialContext(env);
      return ic.lookup(name);
    }else{
      return namingManager.getInitialContext().lookup(name);
    }
  }
}
origin: org.glassfish.common/container-common

glassfishNamingManager.getInitialContext().lookup(lookupName);
origin: org.glassfish.main.resourcebase.resources/nucleus-resources

public Object lookup(GenericResourceInfo resourceInfo, String name, Hashtable env) throws NamingException{
  String applicationName = resourceInfo.getApplicationName();
  String moduleName = resourceInfo.getModuleName();
  moduleName = org.glassfish.resourcebase.resources.util.ResourceUtil.getActualModuleName(moduleName);
  if(!isGlobalName(resourceInfo.getName()) && applicationName != null && moduleName != null){
    return namingManager.lookupFromModuleNamespace(applicationName, moduleName, getModuleScopedName(name), env);
  }else if(!isGlobalName(resourceInfo.getName()) && applicationName != null) {
    if(pe.getProcessType().isServer() || pe.getProcessType().isEmbedded()){
      return namingManager.lookupFromAppNamespace(applicationName, getAppScopedName(name), env);
    }else{
      String internalGlobalJavaAppName =
          cnu.composeInternalGlobalJavaAppName(applicationName, getAppScopedName(name));
      if(_logger.isLoggable(Level.FINEST)){
        debug("appclient lookup : " + internalGlobalJavaAppName);
      }
      return namingManager.getInitialContext().lookup(internalGlobalJavaAppName);
    }
  }else{
    if(env != null){
      InitialContext ic = new InitialContext(env);
      return ic.lookup(name);
    }else{
      return namingManager.getInitialContext().lookup(name);
    }
  }
}
org.glassfish.api.namingGlassfishNamingManagergetInitialContext

Javadoc

Get the initial context.

Popular methods of GlassfishNamingManager

  • publishObject
    Publish an object in the naming service.
  • unpublishObject
    Remove an object from the naming service.
  • bindToAppNamespace
    Binds the bindings to module namespace of an application Typically, to get access to application's n
  • restoreJavaCompEnvContext
    Recreate a context for java:comp/env or one of its sub-contexts given the context name.
  • lookup
    Lookup a naming entry for a particular componentId
  • bindToComponentNamespace
    This method enumerates the env properties, ejb and resource references etc for a J2EE component and
  • bindToModuleNamespace
    Binds the bindings to module namespace of an application Typically, to get access to application's m
  • lookupFromAppNamespace
    Lookup a naming entry in a particular application's namespace
  • lookupFromModuleNamespace
    Lookup a naming entry in a particular application's module's namespace
  • publishCosNamingObject
    Publish a CosNaming object. The object is published to both the server's CosNaming service and the g
  • unbindAppObject
    Remove an object from the application's namespace. Typically, to get access to application's namespa
  • unbindAppObjects
    Unbind app and module level bindings for the given app name.
  • unbindAppObject,
  • unbindAppObjects,
  • unbindComponentObjects,
  • unbindModuleObject,
  • unpublishCosNamingObject,
  • initializeRemoteNamingSupport

Popular in Java

  • Running tasks concurrently on multiple threads
  • addToBackStack (FragmentTransaction)
  • onRequestPermissionsResult (Fragment)
  • onCreateOptionsMenu (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • String (java.lang)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now