Examples of Habitat


Examples of org.jvnet.hk2.component.Habitat

    private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
        stream.defaultReadObject();

        //Initialize the transients that were passed at ctor.
        Habitat defaultHabitat = Globals.getDefaultHabitat();
        txManager     = defaultHabitat.getByContract(TransactionManager.class);
        invMgr        = defaultHabitat.getByContract(InvocationManager.class);
        compEnvMgr    = defaultHabitat.getByContract(ComponentEnvManager.class);
        callFlowAgent = defaultHabitat.getByContract(CallFlowAgent.class);
    }
View Full Code Here

Examples of org.jvnet.hk2.component.Habitat

    @Override                        
    public Habitat createHabitat(String name) throws ComponentException {

        StartupContext sc = startupContext;
        Habitat habitat = super.newHabitat();

        if (startupContext==null) {
            sc = new StartupContext(new Properties());
        }
        super.createHabitat("default", habitat);
        habitat.add(Inhabitants.create(sc));
        return habitat;
    }
View Full Code Here

Examples of org.jvnet.hk2.component.Habitat

    /**
     * Creates an uninitialized {@link Habitat}
     *
     */
    public Habitat newHabitat() throws ComponentException {
        Habitat habitat = new Habitat();
        initializeHabitat(habitat);
        return habitat;
    }
View Full Code Here

Examples of org.jvnet.hk2.component.Habitat

     *      Determines which inhabitants descriptors are loaded.
     *      (so that different parallel habitats can be
     *      created over the same modules registry.)
     */
    public Habitat createHabitat(String name) throws ComponentException {
        Habitat h = newHabitat();
        return createHabitat(name, h);
    }
View Full Code Here

Examples of org.jvnet.hk2.component.Habitat

        return createHabitat(name, createInhabitantsParser(h));
    }

    public Habitat createHabitat(String name, InhabitantsParser parser) throws ComponentException {
        try {
            Habitat habitat = parser.habitat;

            for (final Module module : getModules())
                parseInhabitants(module, name,parser);

            populateConfig(habitat);

            // default modules registry is the one that created the habitat
            habitat.addIndex(new ExistingSingletonInhabitant<ModulesRegistry>(this),
                    ModulesRegistry.class.getName(), null);
            habitats.put(name, habitat);

            habitat.initialized();
           
            return habitat;
        } catch (Exception e) {
            throw new ComponentException("Failed to create a habitat",e);
        }
View Full Code Here

Examples of org.jvnet.hk2.component.Habitat

            for( String name : spi.providerNames )
                providers.put(name,newModule);
        }
        for (Map.Entry<String, Habitat> entry : habitats.entrySet()) {
            String name = entry.getKey();
            Habitat h = entry.getValue();
            try
            {
                // TODO: should get the inhabitantsParser out of Main instead since
                // this could have been overridden
                parseInhabitants(newModule, name, createInhabitantsParser(h));
View Full Code Here

Examples of org.jvnet.hk2.component.Habitat

    private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
        stream.defaultReadObject();

        //Initialize the transients that were passed at ctor.
        Habitat defaultHabitat = Globals.getDefaultHabitat();
        invMgr        = defaultHabitat.getByContract(InvocationManager.class);
        compEnvMgr    = defaultHabitat.getByContract(ComponentEnvManager.class);
    }
View Full Code Here

Examples of org.jvnet.hk2.component.Habitat

                }
            };

            // Install the all-trusting trust manager
            SSLContext sc = SSLContext.getInstance(SSL);
            Habitat habitat = Globals.getDefaultHabitat();
            SSLUtils sslUtils = habitat.getComponent(SSLUtils.class);
            sc.init(sslUtils.getKeyManagers(), trustAllCerts, new java.security.SecureRandom());

            //---------------------------------
            url = new URL(HTTPS_PROTOCOL, _lbHost, Integer.parseInt(_lbPort), contextRoot);
            if (_lbProxyHost != null && _lbProxyPort != null) {
View Full Code Here

Examples of org.jvnet.hk2.component.Habitat

                }
            };

            // Install the all-trusting trust manager
            SSLContext sc = SSLContext.getInstance(TLS);
            Habitat habitat = Globals.getDefaultHabitat();
            SSLUtils sslUtils = habitat.getComponent(SSLUtils.class);
            sc.init(sslUtils.getKeyManagers(), trustAllCerts, new java.security.SecureRandom());

            //---------------------------------
            url = new URL(HTTPS_PROTOCOL, _lbHost, Integer.parseInt(_lbPort), contextRoot);
            if (_lbProxyHost != null && _lbProxyPort != null) {
View Full Code Here

Examples of org.jvnet.hk2.component.Habitat

            for (File file : files) {
                DomainDirs dir = new DomainDirs(file);
                File domainXMLFile = dir.getServerDirs().getDomainXml();
                logger.finer("Domain XML file = " + domainXMLFile);
                try {
                    Habitat habitat = Globals.getStaticHabitat();
                    ConfigParser parser = new ConfigParser(habitat);
                    URL domainURL = domainXMLFile.toURI().toURL();
                    DomDocument doc = parser.parse(domainURL);
                    Dom domDomain = doc.getRoot();
                    Domain domain = domDomain.createProxy(Domain.class);
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.