Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/HttpSessionScopeContext.java URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/HttpSessionScopeContext.java?rev=392190&r1=392189&r2=392190&view=diff ============================================================================== --- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/HttpSessionScopeContext.java (original) +++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/HttpSessionScopeContext.java Thu Apr 6 22:37:58 2006 @@ -32,7 +32,7 @@ public class HttpSessionScopeContext extends AbstractScopeContext implements RuntimeEventListener { // The collection of service component contexts keyed by session - private Map<Object, Map<String, InstanceContext>> contexts; + private Map<Object, Map<String, Context>> contexts; // Stores ordered lists of contexts to shutdown keyed by session private Map<Object, Queue<SimpleComponentContext>> destroyableContexts; @@ -47,7 +47,7 @@ throw new IllegalStateException("Scope container must be in UNINITIALIZED state"); } super.start(); - contexts = new ConcurrentHashMap<Object, Map<String, InstanceContext>>(); + contexts = new ConcurrentHashMap<Object, Map<String, Context>>(); destroyableContexts = new ConcurrentHashMap<Object, Queue<SimpleComponentContext>>(); lifecycleState = RUNNING; } @@ -97,24 +97,24 @@ return true; } - public void registerFactory(ContextFactory<InstanceContext> configuration) { + public void registerFactory(ContextFactory<Context> configuration) { contextFactorys.put(configuration.getName(), configuration); } - public InstanceContext getContext(String ctxName) { + public Context getContext(String ctxName) { checkInit(); if (ctxName == null) { return null; } // try{ - Map<String, InstanceContext> ctxs = getSessionContext(); + Map<String, Context> ctxs = getSessionContext(); if (ctxs == null) { return null; } - InstanceContext ctx = ctxs.get(ctxName); + Context ctx = ctxs.get(ctxName); if (ctx == null) { // the configuration was added after the session had started, so create a context now and start it - ContextFactory<InstanceContext> configuration = contextFactorys.get(ctxName); + ContextFactory<Context> configuration = contextFactorys.get(ctxName); if (configuration != null) { ctx = configuration.createContext(); ctx.addListener(this); @@ -125,7 +125,7 @@ return ctx; } - public InstanceContext getContextByKey(String ctxName, Object key) { + public Context getContextByKey(String ctxName, Object key) { checkInit(); if (key == null && ctxName == null) { return null; @@ -134,7 +134,7 @@ if (components == null) { return null; } - return (InstanceContext) components.get(ctxName); + return (Context) components.get(ctxName); } public void removeContext(String ctxName) { @@ -153,8 +153,8 @@ return; } components.remove(ctxName); - Map<String, InstanceContext> definitions = contexts.get(key); - InstanceContext ctx = definitions.get(ctxName); + Map<String, Context> definitions = contexts.get(key); + Context ctx = definitions.get(ctxName); if (ctx != null){ destroyableContexts.get(key).remove(ctx); } @@ -166,7 +166,7 @@ * Returns an array of [EMAIL PROTECTED] SimpleComponentContext}s representing components that need to be notified of scope shutdown or * null if none found. */ - protected InstanceContext[] getShutdownContexts(Object key) { + protected Context[] getShutdownContexts(Object key) { /* * This method will be called from the Listener which is associated with a different thread than the request. So, just * grab the key directly @@ -187,18 +187,18 @@ /** * Returns and, if necessary, creates a context for the current sesion */ - private Map<String, InstanceContext> getSessionContext() throws CoreRuntimeException { + private Map<String, Context> getSessionContext() throws CoreRuntimeException { Object key = getEventContext().getIdentifier(EventContext.HTTP_SESSION); if (key == null) { throw new ScopeRuntimeException("Session key not set in request context"); } - Map<String, InstanceContext> m = contexts.get(key); + Map<String, Context> m = contexts.get(key); if (m != null) { return m; // already created, return } - Map<String, InstanceContext> sessionContext = new ConcurrentHashMap<String, InstanceContext>(contextFactorys.size()); - for (ContextFactory<InstanceContext> config : contextFactorys.values()) { - InstanceContext context = config.createContext(); + Map<String, Context> sessionContext = new ConcurrentHashMap<String, Context>(contextFactorys.size()); + for (ContextFactory<Context> config : contextFactorys.values()) { + Context context = config.createContext(); context.addListener(this); context.start(); sessionContext.put(context.getName(), context); @@ -209,7 +209,7 @@ destroyableContexts.put(key, shutdownQueue); // initialize eager components. Note this cannot be done when we initially create each context since a component may // contain a forward reference to a component which has not been instantiated - for (InstanceContext context : sessionContext.values()) { + for (Context context : sessionContext.values()) { if (context instanceof SimpleComponentContext) { SimpleComponentContext simpleCtx = (SimpleComponentContext) context; if (simpleCtx.isEagerInit()) {
Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/ModuleScopeContext.java URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/ModuleScopeContext.java?rev=392190&r1=392189&r2=392190&view=diff ============================================================================== --- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/ModuleScopeContext.java (original) +++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/ModuleScopeContext.java Thu Apr 6 22:37:58 2006 @@ -32,7 +32,7 @@ public class ModuleScopeContext extends AbstractScopeContext implements RuntimeEventListener { // Component contexts in this scope keyed by name - private Map<String, InstanceContext> componentContexts; + private Map<String, Context> componentContexts; private Queue<SimpleComponentContext> destroyableContexts; @@ -83,26 +83,26 @@ return true; } - public void registerFactory(ContextFactory<InstanceContext> configuration) { + public void registerFactory(ContextFactory<Context> configuration) { contextFactorys.put(configuration.getName(), configuration); if (lifecycleState == RUNNING) { componentContexts.put(configuration.getName(), configuration.createContext()); } } - public InstanceContext getContext(String ctxName) { + public Context getContext(String ctxName) { checkInit(); return componentContexts.get(ctxName); } - public InstanceContext getContextByKey(String ctxName, Object key) { + public Context getContextByKey(String ctxName, Object key) { checkInit(); return componentContexts.get(ctxName); } public void removeContext(String ctxName) { checkInit(); - InstanceContext context = componentContexts.remove(ctxName); + Context context = componentContexts.remove(ctxName); if (context != null) { destroyableContexts.remove(context); } @@ -116,10 +116,10 @@ /** * Returns an array of [EMAIL PROTECTED] SimpleComponentContext}s representing components that need to be notified of scope shutdown. */ - protected InstanceContext[] getShutdownContexts(Object key) { + protected Context[] getShutdownContexts(Object key) { if (destroyableContexts != null) { // create 0-length array since Queue.size() has O(n) traversal - return destroyableContexts.toArray(new InstanceContext[0]); + return destroyableContexts.toArray(new Context[0]); } else { return null; } @@ -127,17 +127,17 @@ private synchronized void initComponentContexts() throws CoreRuntimeException { if (componentContexts == null) { - componentContexts = new ConcurrentHashMap<String, InstanceContext> (); + componentContexts = new ConcurrentHashMap<String, Context> (); destroyableContexts = new ConcurrentLinkedQueue<SimpleComponentContext>(); - for (ContextFactory<InstanceContext> config : contextFactorys.values()) { - InstanceContext context = config.createContext(); + for (ContextFactory<Context> config : contextFactorys.values()) { + Context context = config.createContext(); context.addListener(this); context.start(); componentContexts.put(context.getName(), context); } // Initialize eager contexts. Note this cannot be done when we initially create each context since a component may // contain a forward reference to a component which has not been instantiated - for (InstanceContext context : componentContexts.values()) { + for (Context context : componentContexts.values()) { if (context instanceof SimpleComponentContext) { SimpleComponentContext simpleCtx = (SimpleComponentContext) context; if (simpleCtx.isEagerInit()) { Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/RequestScopeContext.java URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/RequestScopeContext.java?rev=392190&r1=392189&r2=392190&view=diff ============================================================================== --- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/RequestScopeContext.java (original) +++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/RequestScopeContext.java Thu Apr 6 22:37:58 2006 @@ -33,7 +33,7 @@ // A collection of service component contexts keyed by thread. Note this could have been implemented with a ThreadLocal but // using a Map allows finer-grained concurrency. - private Map<Object, Map<String, InstanceContext>> contextMap; + private Map<Object, Map<String, Context>> contextMap; // stores ordered lists of contexts to shutdown for each thread. private Map<Object, Queue<SimpleComponentContext>> destroyComponents; @@ -54,8 +54,8 @@ break; case EventContext.CONTEXT_CREATED: checkInit(); - assert(key instanceof InstanceContext): "Context must be passed on created event"; - InstanceContext context = (InstanceContext)key; + assert(key instanceof Context): "Context must be passed on created event"; + Context context = (Context)key; if (context instanceof SimpleComponentContext) { SimpleComponentContext simpleCtx = (SimpleComponentContext)context; // Queue the context to have its implementation instance released if destroyable @@ -73,7 +73,7 @@ throw new IllegalStateException("Scope must be in UNINITIALIZED state [" + lifecycleState + "]"); } super.start(); - contextMap = new ConcurrentHashMap<Object, Map<String, InstanceContext>>(); + contextMap = new ConcurrentHashMap<Object, Map<String, Context>>(); destroyComponents = new ConcurrentHashMap<Object, Queue<SimpleComponentContext>>(); lifecycleState = RUNNING; @@ -97,17 +97,17 @@ return true; } - public void registerFactory(ContextFactory<InstanceContext> configuration) { + public void registerFactory(ContextFactory<Context> configuration) { contextFactorys.put(configuration.getName(), configuration); } - public InstanceContext getContext(String ctxName) { + public Context getContext(String ctxName) { checkInit(); - Map<String, InstanceContext> contexts = getComponentContexts(); - InstanceContext ctx = contexts.get(ctxName); + Map<String, Context> contexts = getComponentContexts(); + Context ctx = contexts.get(ctxName); if (ctx == null){ // check to see if the configuration was added after the request was started - ContextFactory<InstanceContext> configuration = contextFactorys.get(ctxName); + ContextFactory<Context> configuration = contextFactorys.get(ctxName); if (configuration != null) { ctx = configuration.createContext(); ctx.addListener(this); @@ -118,12 +118,12 @@ return ctx; } - public InstanceContext getContextByKey(String ctxName, Object key) { + public Context getContextByKey(String ctxName, Object key) { checkInit(); if (key == null) { return null; } - Map<String, InstanceContext> components = contextMap.get(key); + Map<String, Context> components = contextMap.get(key); if (components == null) { return null; } @@ -145,10 +145,10 @@ return; } components.remove(ctxName); - Map<String, InstanceContext> contexts = contextMap.get(key); + Map<String, Context> contexts = contextMap.get(key); // no synchronization for the following two operations since the request // context will not be shutdown before the second call is processed - InstanceContext context = contexts.get(ctxName); + Context context = contexts.get(ctxName); destroyComponents.get(key).remove(context); } @@ -156,12 +156,12 @@ /** * Returns an array of [EMAIL PROTECTED] SimpleComponentContext}s representing components that need to be notified of scope shutdown. */ - protected InstanceContext[] getShutdownContexts(Object key) { + protected Context[] getShutdownContexts(Object key) { checkInit(); Queue<SimpleComponentContext> queue = destroyComponents.get(Thread.currentThread()); if (queue != null) { // create 0-length array since Queue.size() has O(n) traversal - return queue.toArray(new InstanceContext[0]); + return queue.toArray(new Context[0]); } else { return null; } @@ -182,13 +182,13 @@ * TODO Eager initialization is not performed for request-scoped components */ - private Map<String, InstanceContext> getComponentContexts() throws CoreRuntimeException { - Map<String, InstanceContext> contexts = contextMap.get(Thread.currentThread()); + private Map<String, Context> getComponentContexts() throws CoreRuntimeException { + Map<String, Context> contexts = contextMap.get(Thread.currentThread()); if (contexts == null) { - contexts = new ConcurrentHashMap<String, InstanceContext>(); + contexts = new ConcurrentHashMap<String, Context>(); Queue<SimpleComponentContext> shutdownQueue = new ConcurrentLinkedQueue<SimpleComponentContext>(); - for (ContextFactory<InstanceContext> config : contextFactorys.values()) { - InstanceContext context = config.createContext(); + for (ContextFactory<Context> config : contextFactorys.values()) { + Context context = config.createContext(); context.addListener(this); context.start(); contexts.put(context.getName(), context); Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/StatelessScopeContext.java URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/StatelessScopeContext.java?rev=392190&r1=392189&r2=392190&view=diff ============================================================================== --- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/StatelessScopeContext.java (original) +++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/StatelessScopeContext.java Thu Apr 6 22:37:58 2006 @@ -30,7 +30,7 @@ public class StatelessScopeContext extends AbstractScopeContext implements RuntimeEventListener { // Component contexts keyed by name - private Map<String, InstanceContext> contextMap; + private Map<String, Context> contextMap; public StatelessScopeContext(EventContext eventContext) { super(eventContext); @@ -55,7 +55,7 @@ lifecycleState = STOPPED; } - public void registerFactory(ContextFactory<InstanceContext> configuration) { + public void registerFactory(ContextFactory<Context> configuration) { contextFactorys.put(configuration.getName(), configuration); if (lifecycleState == RUNNING) { contextMap.put(configuration.getName(), configuration.createContext()); @@ -71,11 +71,11 @@ return true; } - public InstanceContext getContext(String ctxName) { + public Context getContext(String ctxName) { return contextMap.get(ctxName); } - public InstanceContext getContextByKey(String ctxName, Object key) { + public Context getContextByKey(String ctxName, Object key) { return getContext(ctxName); } @@ -90,7 +90,7 @@ /** * Always returns null since stateless components cannot be shutdown */ - protected InstanceContext[] getShutdownContexts(Object key) { + protected Context[] getShutdownContexts(Object key) { return null; } @@ -99,10 +99,10 @@ throw new IllegalStateException("Scope not in INITIALIZED state [" + lifecycleState + "]"); } if (contextMap == null) { - contextMap = new ConcurrentHashMap<String, InstanceContext> (); - for (ContextFactory<InstanceContext> config : contextFactorys.values()) { + contextMap = new ConcurrentHashMap<String, Context> (); + for (ContextFactory<Context> config : contextFactorys.values()) { for (int i = 0; i < contextFactorys.size(); i++) { - InstanceContext context = config.createContext(); + Context context = config.createContext(); context.addListener(this); context.start(); contextMap.put(context.getName(), context); Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/injection/InterAggregateReferenceFactory.java URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/injection/InterAggregateReferenceFactory.java?rev=392190&r1=392189&r2=392190&view=diff ============================================================================== --- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/injection/InterAggregateReferenceFactory.java (original) +++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/injection/InterAggregateReferenceFactory.java Thu Apr 6 22:37:58 2006 @@ -16,7 +16,7 @@ import org.apache.tuscany.core.builder.ContextResolver; import org.apache.tuscany.core.builder.ObjectFactory; import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.InstanceContext; +import org.apache.tuscany.core.context.Context; import org.apache.tuscany.core.context.QualifiedName; import org.apache.tuscany.core.context.TargetException; @@ -57,7 +57,7 @@ if (ctx == null) { break; // reached top of context hierarchy } - InstanceContext compContext = ctx.getContext(targetQualifiedName.getPartName()); + Context compContext = ctx.getContext(targetQualifiedName.getPartName()); if (compContext != null) { o = compContext.getInstance(targetQualifiedName); if (o != null) { Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemContextFactory.java URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemContextFactory.java?rev=392190&r1=392189&r2=392190&view=diff ============================================================================== --- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemContextFactory.java (original) +++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemContextFactory.java Thu Apr 6 22:37:58 2006 @@ -6,7 +6,7 @@ import org.apache.tuscany.core.builder.ContextResolver; import org.apache.tuscany.core.config.ConfigurationException; import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.InstanceContext; +import org.apache.tuscany.core.context.Context; import org.apache.tuscany.core.injection.EventInvoker; import org.apache.tuscany.core.injection.Injector; import org.apache.tuscany.core.injection.PojoObjectFactory; @@ -30,7 +30,7 @@ * * @version $Rev$ $Date$ */ -public class SystemContextFactory implements ContextFactory<InstanceContext>, ContextResolver { +public class SystemContextFactory implements ContextFactory<Context>, ContextResolver { // the component name as configured in the hosting module private String name; @@ -115,7 +115,7 @@ return scope; } - public InstanceContext createContext() throws ContextCreationException { + public Context createContext() throws ContextCreationException { if (isAggregate) { try { // aggregate context types are themselves an instance context Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemObjectContextFactory.java URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemObjectContextFactory.java?rev=392190&r1=392189&r2=392190&view=diff ============================================================================== --- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemObjectContextFactory.java (original) +++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemObjectContextFactory.java Thu Apr 6 22:37:58 2006 @@ -21,7 +21,7 @@ import org.apache.tuscany.core.builder.ContextFactory; import org.apache.tuscany.core.builder.ObjectFactory; import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.InstanceContext; +import org.apache.tuscany.core.context.Context; import org.apache.tuscany.core.injection.SingletonObjectFactory; import org.apache.tuscany.core.invocation.spi.ProxyFactory; import org.apache.tuscany.core.system.context.SystemComponentContext; @@ -52,7 +52,7 @@ objectFactory = new SingletonObjectFactory<Object>(instance); } - public InstanceContext createContext() throws ContextCreationException { + public Context createContext() throws ContextCreationException { return new SystemComponentContext(name, objectFactory, false, null, null, false); } Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemAggregateContextImpl.java URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemAggregateContextImpl.java?rev=392190&r1=392189&r2=392190&view=diff ============================================================================== --- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemAggregateContextImpl.java (original) +++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemAggregateContextImpl.java Thu Apr 6 22:37:58 2006 @@ -75,7 +75,7 @@ // protected ModuleComponent moduleComponent; protected Module module; - protected List<ContextFactory<InstanceContext>> configurations = new ArrayList<ContextFactory<InstanceContext>>(); + protected List<ContextFactory<Context>> configurations = new ArrayList<ContextFactory<Context>>(); protected ScopeStrategy scopeStrategy; @@ -157,9 +157,9 @@ lifecycleState = INITIALIZING; initializeScopes(); - Map<Scope, List<ContextFactory<InstanceContext>>> configurationsByScope = new HashMap<Scope, List<ContextFactory<InstanceContext>>>(); + Map<Scope, List<ContextFactory<Context>>> configurationsByScope = new HashMap<Scope, List<ContextFactory<Context>>>(); if (configurations != null) { - for (ContextFactory<InstanceContext> config : configurations) { + for (ContextFactory<Context> config : configurations) { // FIXME scopes are defined at the interface level Scope scope = config.getScope(); // ensure duplicate names were not added before the context was started @@ -167,9 +167,9 @@ throw new DuplicateNameException(config.getName()); } scopeIndex.put(config.getName(), scopeContexts.get(scope)); - List<ContextFactory<InstanceContext>> list = configurationsByScope.get(scope); + List<ContextFactory<Context>> list = configurationsByScope.get(scope); if (list == null) { - list = new ArrayList<ContextFactory<InstanceContext>>(); + list = new ArrayList<ContextFactory<Context>>(); configurationsByScope.put(scope, list); } list.add(config); @@ -184,7 +184,7 @@ for (ExternalService es : module.getExternalServices()) { registerAutowire(es); } - for (Map.Entry<Scope, List<ContextFactory<InstanceContext>>> entries : configurationsByScope.entrySet()) { + for (Map.Entry<Scope, List<ContextFactory<Context>>> entries : configurationsByScope.entrySet()) { // register configurations with scope contexts ScopeContext scope = scopeContexts.get(entries.getKey()); scope.registerFactories(entries.getValue()); @@ -284,14 +284,14 @@ throw e; } } - ContextFactory<InstanceContext> configuration; + ContextFactory<Context> configuration; if (model instanceof Module) { // merge new module definition with the existing one Module oldModule = module; Module newModule = (Module) model; module = newModule; for (Component component : newModule.getComponents()) { - configuration = (ContextFactory<InstanceContext>) component.getComponentImplementation().getContextFactory(); + configuration = (ContextFactory<Context>) component.getComponentImplementation().getContextFactory(); if (configuration == null) { ConfigurationException e = new ConfigurationException("Runtime configuration not set"); e.addContextName(component.getName()); @@ -302,7 +302,7 @@ registerAutowire(component); } for (EntryPoint ep : newModule.getEntryPoints()) { - configuration = (ContextFactory<InstanceContext>) ep.getConfiguredReference().getContextFactory(); + configuration = (ContextFactory<Context>) ep.getConfiguredReference().getContextFactory(); if (configuration == null) { ConfigurationException e = new ConfigurationException("Runtime configuration not set"); e.setIdentifier(ep.getName()); @@ -313,7 +313,7 @@ registerAutowire(ep); } for (ExternalService service : newModule.getExternalServices()) { - configuration = (ContextFactory<InstanceContext>) service.getConfiguredService().getContextFactory(); + configuration = (ContextFactory<Context>) service.getConfiguredService().getContextFactory(); if (configuration == null) { ConfigurationException e = new ConfigurationException("Runtime configuration not set"); e.setIdentifier(service.getName()); @@ -331,15 +331,15 @@ if (model instanceof Component) { Component component = (Component) model; module.getComponents().add(component); - configuration = (ContextFactory<InstanceContext>) component.getComponentImplementation().getContextFactory(); + configuration = (ContextFactory<Context>) component.getComponentImplementation().getContextFactory(); } else if (model instanceof EntryPoint) { EntryPoint ep = (EntryPoint) model; module.getEntryPoints().add(ep); - configuration = (ContextFactory<InstanceContext>) ep.getConfiguredReference().getContextFactory(); + configuration = (ContextFactory<Context>) ep.getConfiguredReference().getContextFactory(); } else if (model instanceof ExternalService) { ExternalService service = (ExternalService) model; module.getExternalServices().add(service); - configuration = (ContextFactory<InstanceContext>) service.getConfiguredService().getContextFactory(); + configuration = (ContextFactory<Context>) service.getConfiguredService().getContextFactory(); } else { BuilderConfigException e = new BuilderConfigException("Unknown model type"); e.setIdentifier(model.getClass().getName()); @@ -368,7 +368,7 @@ autowireIndex.put(service, mapping); } - protected void registerConfiguration(ContextFactory<InstanceContext> factory) throws ConfigurationException { + protected void registerConfiguration(ContextFactory<Context> factory) throws ConfigurationException { factory.prepare(this); if (lifecycleState == RUNNING) { if (scopeIndex.get(factory.getName()) != null) { @@ -413,7 +413,7 @@ } } - public InstanceContext getContext(String componentName) { + public Context getContext(String componentName) { checkInit(); assert (componentName != null) : "Name was null"; ScopeContext scope = scopeIndex.get(componentName); @@ -435,7 +435,7 @@ if (scope == null) { return null; } - InstanceContext ctx = scope.getContext(qName.getPortName()); + Context ctx = scope.getContext(qName.getPortName()); if (!(ctx instanceof EntryPointContext)) { TargetException e = new TargetException("Target not an entry point"); e.setIdentifier(qName.getQualifiedName()); Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemEntryPointContext.java URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemEntryPointContext.java?rev=392190&r1=392189&r2=392190&view=diff ============================================================================== --- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemEntryPointContext.java (original) +++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/context/SystemEntryPointContext.java Thu Apr 6 22:37:58 2006 @@ -42,7 +42,7 @@ public Object getInstance(QualifiedName qName) throws TargetException { try { if (cachedInstance == null) { - InstanceContext ctx = resolver.getCurrentContext().getContext(targetName.getPartName()); + Context ctx = resolver.getCurrentContext().getContext(targetName.getPartName()); if (ctx == null){ return null; } Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockScopeContext.java URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockScopeContext.java?rev=392190&r1=392189&r2=392190&view=diff ============================================================================== --- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockScopeContext.java (original) +++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/invocation/mock/MockScopeContext.java Thu Apr 6 22:37:58 2006 @@ -92,10 +92,10 @@ } - public void registerFactories(List<ContextFactory<InstanceContext>> configurations) { + public void registerFactories(List<ContextFactory<Context>> configurations) { } - public void registerFactory(ContextFactory<InstanceContext> configuration) { + public void registerFactory(ContextFactory<Context> configuration) { } public int getLifecycleState(){ Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeBootTestCase.java URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeBootTestCase.java?rev=392190&r1=392189&r2=392190&view=diff ============================================================================== --- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeBootTestCase.java (original) +++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeBootTestCase.java Thu Apr 6 22:37:58 2006 @@ -19,7 +19,7 @@ import org.apache.tuscany.core.builder.ContextFactoryBuilder; import org.apache.tuscany.core.context.AggregateContext; import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.InstanceContext; +import org.apache.tuscany.core.context.Context; import org.apache.tuscany.core.mock.MockFactory; import java.util.List; @@ -47,13 +47,13 @@ } public void testRuntimeLifecycle() { - assertEquals(InstanceContext.RUNNING, runtime.getLifecycleState()); + assertEquals(Context.RUNNING, runtime.getLifecycleState()); runtime.stop(); - assertEquals(InstanceContext.STOPPED, runtime.getLifecycleState()); + assertEquals(Context.STOPPED, runtime.getLifecycleState()); runtime.start(); - assertEquals(InstanceContext.RUNNING, runtime.getLifecycleState()); + assertEquals(Context.RUNNING, runtime.getLifecycleState()); } public void testIncrementalBoot() throws Exception{ @@ -77,7 +77,7 @@ system.fireEvent(EventContext.MODULE_STOP, null); runtimeContext.stop(); - Assert.assertEquals(InstanceContext.STOPPED,system.getLifecycleState()); + Assert.assertEquals(Context.STOPPED,system.getLifecycleState()); } protected void setUp() throws Exception { Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeContextImplTestCase.java URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeContextImplTestCase.java?rev=392190&r1=392189&r2=392190&view=diff ============================================================================== --- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeContextImplTestCase.java (original) +++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/runtime/RuntimeContextImplTestCase.java Thu Apr 6 22:37:58 2006 @@ -20,7 +20,7 @@ import org.apache.tuscany.core.config.ConfigurationException; import org.apache.tuscany.core.context.AggregateContext; import org.apache.tuscany.core.context.EventContext; -import org.apache.tuscany.core.context.InstanceContext; +import org.apache.tuscany.core.context.Context; import org.apache.tuscany.core.context.impl.AggregateContextImpl; import org.apache.tuscany.core.mock.MockFactory; import org.apache.tuscany.core.mock.component.ModuleScopeSystemComponent; @@ -56,7 +56,7 @@ AggregateContext root = runtime.getRootContext(); Assert.assertNotNull(root); - Assert.assertTrue(root.getLifecycleState() == InstanceContext.RUNNING); + Assert.assertTrue(root.getLifecycleState() == Context.RUNNING); AggregateContext system = runtime.getSystemContext(); Assert.assertNotNull(system); @@ -105,7 +105,7 @@ AggregateContext root = runtime.getRootContext(); Assert.assertNotNull(root); - Assert.assertTrue(root.getLifecycleState() == InstanceContext.RUNNING); + Assert.assertTrue(root.getLifecycleState() == Context.RUNNING); AggregateContext system = runtime.getSystemContext(); Assert.assertNotNull(system); Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/system/builder/SystemContextFactoryBuilderTestCase.java URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/system/builder/SystemContextFactoryBuilderTestCase.java?rev=392190&r1=392189&r2=392190&view=diff ============================================================================== --- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/system/builder/SystemContextFactoryBuilderTestCase.java (original) +++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/system/builder/SystemContextFactoryBuilderTestCase.java Thu Apr 6 22:37:58 2006 @@ -18,7 +18,7 @@ import org.apache.tuscany.common.monitor.impl.NullMonitorFactory; import org.apache.tuscany.core.builder.ContextFactory; import org.apache.tuscany.core.context.AggregateContext; -import org.apache.tuscany.core.context.InstanceContext; +import org.apache.tuscany.core.context.Context; import org.apache.tuscany.core.context.impl.AggregateContextImpl; import org.apache.tuscany.core.context.impl.EventContextImpl; import org.apache.tuscany.core.context.scope.DefaultScopeStrategy; @@ -103,7 +103,7 @@ ContextFactory contextFactory = (ContextFactory) component.getComponentImplementation().getContextFactory(); Assert.assertNotNull(contextFactory); contextFactory.prepare(createContext()); - InstanceContext ctx = contextFactory.createContext(); + Context ctx = contextFactory.createContext(); ctx.start(); SystemComponentImpl instance = (SystemComponentImpl) ctx.getInstance(null);
