Package org.apache.tuscany.core.context

Examples of org.apache.tuscany.core.context.DuplicateNameException


    protected void registerConfiguration(ContextFactory<Context> factory) throws ConfigurationException {
        factory.prepare(this);
        if (lifecycleState == RUNNING) {
            if (scopeIndex.get(factory.getName()) != null) {
                throw new DuplicateNameException(factory.getName());
            }
            try {
                ScopeContext scope = scopeContexts.get(factory.getScope());
                if (scope == null) {
                    ConfigurationException e = new MissingScopeException("Component has an unknown scope");
                    e.addContextName(factory.getName());
                    e.addContextName(getName());
                    throw e;
                }
                scope.registerFactory(factory);
                scopeIndex.put(factory.getName(), scope);
            } catch (TuscanyRuntimeException e) {
                e.addContextName(getName());
                throw e;
            }
            configurations.put(factory.getName(), factory); // xcv
        } else {
            if (configurations.get(factory.getName()) != null) {
                throw new DuplicateNameException(factory.getName());
            }
            configurations.put(factory.getName(), factory);
        }

    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.core.context.DuplicateNameException

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.