Package org.apache.stanbol.ontologymanager.multiplexer.clerezza.impl

Examples of org.apache.stanbol.ontologymanager.multiplexer.clerezza.impl.SessionImpl


         * before creating a new one.
         */
        if (sessionsByID.containsKey(sessionID)) throw new DuplicateSessionIDException(sessionID.toString());
        checkSessionLimit();
        IRI ns = IRI.create(getDefaultNamespace() + getID() + "/");
        Session session = new SessionImpl(sessionID, ns, ontologyProvider);

        // Have the ontology provider listen to ontology events
        if (ontologyProvider instanceof OntologyCollectorListener) session
                .addOntologyCollectorListener((OntologyCollectorListener) ontologyProvider);
        if (ontologyProvider instanceof SessionListener) session
                .addSessionListener((SessionListener) ontologyProvider);

        Multiplexer multiplexer = ontologyProvider.getOntologyNetworkDescriptor();
        session.addOntologyCollectorListener(multiplexer);
        session.addSessionListener(multiplexer);

        ConnectivityPolicy policy;
        try {
            policy = ConnectivityPolicy.valueOf(connectivityPolicyString);
        } catch (IllegalArgumentException e) {
            log.warn("The value {}", connectivityPolicyString);
            log.warn(" -- configured as default ConnectivityPolicy does not match any value of the Enumeration!");
            log.warn(" -- Setting the default policy as defined by the {}.", ConnectivityPolicy.class);
            policy = ConnectivityPolicy.valueOf(_CONNECTIVITY_POLICY_DEFAULT);
        }
        session.setConnectivityPolicy(policy);

        addSession(session);
        fireSessionCreated(session);
        return session;
    }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.ontologymanager.multiplexer.clerezza.impl.SessionImpl

Copyright © 2018 www.massapicom. 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.