Package javax.naming

Examples of javax.naming.Context.unbind()


        }

        for (PersistenceUnitInfo unitInfo : appInfo.persistenceUnits) {
            try {
                Object object = globalContext.lookup("openejb/PersistenceUnit/" + unitInfo.id);
                globalContext.unbind("openejb/PersistenceUnit/"+unitInfo.id);

                // close EMF so all resources are released
                ((EntityManagerFactory) object).close();
                persistenceClassLoaderHandler.destroy(unitInfo.id);
            } catch (Throwable t) {
View Full Code Here


            }
        }

        for (String sId : moduleIds) {
            try {
                globalContext.unbind(VALIDATOR_FACTORY_NAMING_CONTEXT + sId);
                globalContext.unbind(VALIDATOR_NAMING_CONTEXT + sId);
            } catch (NamingException e) {
                undeployException.getCauses().add(new Exception("validator: " + sId + ": " + e.getMessage(), e));
            }
        }
View Full Code Here

        }

        for (String sId : moduleIds) {
            try {
                globalContext.unbind(VALIDATOR_FACTORY_NAMING_CONTEXT + sId);
                globalContext.unbind(VALIDATOR_NAMING_CONTEXT + sId);
            } catch (NamingException e) {
                undeployException.getCauses().add(new Exception("validator: " + sId + ": " + e.getMessage(), e));
            }
        }
        moduleIds.clear();
View Full Code Here

        deployments.clear();

        for (String clientId : clientIds) {
            try {
                globalContext.unbind("/openejb/client/" + clientId);
            } catch (Throwable t) {
                undeployException.getCauses().add(new Exception("client: " + clientId + ": " + t.getMessage(), t));
            }
        }
View Full Code Here

        final ResolveResult resolveResult = getBaseURLContext( name, getRawEnvironment() );
        final Context context = (Context)resolveResult.getResolvedObj();

        try
        {
            context.unbind( resolveResult.getRemainingName() );
        }
        finally
        {
            context.close();
        }
View Full Code Here

     * @exception A NamingException thrown if an error occured when working with JNDI
   */
    public static void recursiveUnbind(String name) throws NamingException {
        String[] tokens = parseString(name);
        Context startingContext = getInitialContext();
        startingContext.unbind(name);

        for (int i = tokens.length - 2; i >= 0; i--) {
            startingContext.destroySubcontext(tokens[i]);
        }
    }
View Full Code Here

            doLocalUnbind( name );
        }
        else
        {
            final Context context = lookupSubContext( getPathName( name ) );
            context.unbind( getLeafName( name ) );
        }
    }

    /**
     * Actually unbind raw entry in local context.
View Full Code Here

   {
      if (m_isRunning)
      {
         PortableRemoteObject.unexportObject(this);
         Context ctx = new InitialContext();
         ctx.unbind(IIOP_JNDI_NAME);
         m_isRunning = false;
         System.out.println("My Service Servant stopped successfully");
      }
   }
View Full Code Here

        subCtx2.bind(name, name);

        Assert.assertEquals("data in handler", name, handler.getData().get(name));

        subCtx2.unbind(name);

        Assert.assertNull("data in handler", handler.getData().get(name));
    }

View Full Code Here

            }

            JndiBuilder.Bindings bindings = deployment.get(JndiBuilder.Bindings.class);
            if (bindings != null) for (String name : bindings.getBindings()) {
                try {
                    globalContext.unbind(name);
                } catch (Throwable t) {
                    undeployException.getCauses().add(new Exception("bean: " + deploymentID + ": " + t.getMessage(), t));
                }
            }
        }
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.