Examples of NamingContext


Examples of org.apache.naming.NamingContext

            if (initialized)
                return;

            Hashtable contextEnv = new Hashtable();
            try {
                namingContext = new NamingContext(contextEnv, getName());
            } catch (NamingException e) {
                // Never happens
            }
            ContextAccessController.setSecurityToken(getName(), container);
            ContextBindings.bindContext(container, namingContext, container);
View Full Code Here

Examples of org.apache.naming.NamingContext

            if (initialized)
                return;

            Hashtable<String, Object> contextEnv = new Hashtable<String, Object>();
            try {
                namingContext = new NamingContext(contextEnv, getName());
            } catch (NamingException e) {
                // Never happens
            }
            ContextAccessController.setSecurityToken(getName(), container);
            ContextBindings.bindContext(container, namingContext, container);
View Full Code Here

Examples of org.apache.naming.NamingContext

                return;

            try {
                Hashtable<String, Object> contextEnv = new Hashtable<String, Object>();
                try {
                    namingContext = new NamingContext(contextEnv, getName());
                } catch (NamingException e) {
                    // Never happens
                }
                ContextAccessController.setSecurityToken(getName(), container);
                ContextAccessController.setSecurityToken(container, container);
View Full Code Here

Examples of org.apache.naming.NamingContext

            // Redirect the request to the bound initial context
            return new SelectorContext(environment, true);
        } else {
            // If the thread is not bound, return a shared writable context
            if (initialContext == null)
                initialContext = new NamingContext(environment, MAIN);
            return initialContext;
        }
    }
View Full Code Here

Examples of org.apache.naming.NamingContext

            if (initialized)
                return;

            Hashtable contextEnv = new Hashtable();
            try {
                namingContext = new NamingContext(contextEnv, getName());
            } catch (NamingException e) {
                // Never happens
            }
            ContextAccessController.setSecurityToken(getName(), container);
            ContextBindings.bindContext(container, namingContext, container);
View Full Code Here

Examples of org.eclipse.jetty.jndi.NamingContext

        {
            initCtx.lookup( JNDI_ENV_ROOT );
        }
        catch ( NameNotFoundException e )
        {
            initCtx.bind( JNDI_ENV_ROOT, new NamingContext(new Hashtable<String, Object>(), JNDI_ENV_ROOT, null, new InitialContextFactory.DefaultParser()) );
            log.error( "No JNDI " + JNDI_ENV_ROOT + " namespace found; creating it," );
        }
        log.info( "Initialized JNDI " + JNDI_ENV_ROOT + " namespace.=" + contextFactoryClass );
       
        // Initialize new Jetty server
View Full Code Here

Examples of org.gatein.naming.NamingContext

*/
public class javaURLContextFactory implements ObjectFactory {

    /** {@inheritDoc} */
    public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {
        return new NamingContext(name != null ? name : new CompositeName(""), (Hashtable<String, Object>) environment);
    }
View Full Code Here

Examples of org.jboss.as.naming.NamingContext

                final ServiceName appContextName = ContextNames.contextServiceNameOfApplication(appName);
                final ServiceController<?> appContextController = serviceRegistry.getService(appContextName);
                if (appContextController != null) {
                    final NamingStore appStore = NamingStore.class.cast(appContextController.getValue());
                    try {
                        context.addEntries(deploymentNode.get("java:app"), new NamingContext(appStore, null));
                    } catch (NamingException e) {
                        throw new OperationFailedException(e, new ModelNode().set(MESSAGES.failedToRead("java:app", appName)));
                    }
                }
View Full Code Here

Examples of org.jboss.as.naming.NamingContext

        final ServiceName moduleContextName = ContextNames.contextServiceNameOfModule(appName, moduleName);
        final ServiceController<?> moduleContextController = serviceRegistry.getService(moduleContextName);
        if (moduleContextController != null) {
            final NamingStore moduleStore = NamingStore.class.cast(moduleContextController.getValue());
            try {
                context.addEntries(moduleNode.get("java:module"), new NamingContext(moduleStore, null));
            } catch (NamingException e) {
                throw new OperationFailedException(e, new ModelNode().set(MESSAGES.failedToRead("java:module", appName, moduleName)));
            }

            final Collection<ComponentDescription> componentDescriptions = moduleDescription.getComponentDescriptions();
            for (ComponentDescription componentDescription : componentDescriptions) {
                final String componentName = componentDescription.getComponentName();
                final ServiceName compContextServiceName = ContextNames.contextServiceNameOfComponent(appName, moduleName, componentName);
                final ServiceController<?> compContextController = serviceRegistry.getService(compContextServiceName);
                if (compContextController != null) {
                    final ModelNode componentNode = moduleNode.get("components").get(componentName);
                    final NamingStore compStore = NamingStore.class.cast(compContextController.getValue());
                    try {
                        context.addEntries(componentNode.get("java:comp"), new NamingContext(compStore, null));
                    } catch (NamingException e) {
                        throw new OperationFailedException(e, new ModelNode().set(MESSAGES.failedToRead("java:comp", appName, moduleName, componentName)));
                    }
                }
            }
View Full Code Here

Examples of org.jboss.as.naming.NamingContext

                    final ModelNode contextsNode = resultNode.get("java: contexts");

                    final ServiceController<?> javaContextService = serviceRegistry.getService(ContextNames.JAVA_CONTEXT_SERVICE_NAME);
                    final NamingStore javaContextNamingStore = NamingStore.class.cast(javaContextService.getValue());
                    try {
                        addEntries(contextsNode.get("java:"), new NamingContext(javaContextNamingStore, null));
                    } catch (NamingException e) {
                        throw new OperationFailedException(e, new ModelNode().set(MESSAGES.failedToReadContextEntries("java:")));
                    }

                    final ServiceController<?> jbossContextService = serviceRegistry.getService(ContextNames.JBOSS_CONTEXT_SERVICE_NAME);
                    final NamingStore jbossContextNamingStore = NamingStore.class.cast(jbossContextService.getValue());
                    try {
                        addEntries(contextsNode.get("java:jboss"), new NamingContext(jbossContextNamingStore, null));
                    } catch (NamingException e) {
                        throw new OperationFailedException(e, new ModelNode().set(MESSAGES.failedToReadContextEntries("java:jboss")));
                    }

                    final ServiceController<?> globalContextService = serviceRegistry.getService(ContextNames.GLOBAL_CONTEXT_SERVICE_NAME);
                    final NamingStore globalContextNamingStore = NamingStore.class.cast(globalContextService.getValue());
                    try {
                        addEntries(contextsNode.get("java:global"), new NamingContext(globalContextNamingStore, null));
                    } catch (NamingException e) {
                        throw new OperationFailedException(e, new ModelNode().set(MESSAGES.failedToReadContextEntries("java:global")));
                    }

                    final ServiceController<?> extensionRegistryController = serviceRegistry.getService(JndiViewExtensionRegistry.SERVICE_NAME);
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.