summaryrefslogtreecommitdiffstats
path: root/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock
diff options
context:
space:
mode:
Diffstat (limited to 'tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock')
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockConfigContext.java64
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockContextFactory.java92
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockFactory.java819
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockScopeContext.java131
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBinding.java58
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBindingBuilder.java114
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBindingWireBuilder.java76
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooClient.java37
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooEntryPointContextFactory.java31
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooExternalServiceContextFactory.java32
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooExternalServiceTargetInvoker.java78
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/AbstractGenericComponent.java296
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/BadContextPojo.java26
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/BadNamePojo.java24
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/DataObject.java38
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/GenericComponent.java142
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/HelloWorldClient.java46
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/LocalComponentImpl.java97
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponent.java31
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponentImpl.componentType32
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponentImpl.java38
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeDestroyOnlyComponent.java34
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeEagerInitComponent.java39
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeEagerInitDestroyComponent.java33
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeInitDestroyComponent.java37
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeInitOnlyComponent.java41
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/OtherTarget.java27
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/OtherTargetImpl.java35
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RemotableService.java40
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RemotableServiceImpl.java61
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeComponent.java28
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeComponentImpl.java25
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeDestroyOnlyComponent.java36
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeInitDestroyComponent.java36
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeInitOnlyComponent.java37
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeComponent.java28
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeComponentImpl.java28
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeDestroyOnlyComponent.java34
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeInitDestroyComponent.java34
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeInitOnlyComponent.java35
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/Source.java32
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SourceImpl.java63
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/StatelessComponent.java28
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/StatelessComponentImpl.java25
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/Target.java27
-rw-r--r--tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/TargetImpl.java33
46 files changed, 0 insertions, 3178 deletions
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockConfigContext.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockConfigContext.java
deleted file mode 100644
index 9cb1998d68..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockConfigContext.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.tuscany.container.java.mock;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.core.builder.BuilderConfigException;
-import org.apache.tuscany.core.builder.ContextFactoryBuilder;
-import org.apache.tuscany.core.builder.WireBuilder;
-import org.apache.tuscany.core.builder.impl.AssemblyVisitorImpl;
-import org.apache.tuscany.core.builder.impl.DefaultWireBuilder;
-import org.apache.tuscany.core.context.ConfigurationContext;
-import org.apache.tuscany.core.context.ScopeContext;
-import org.apache.tuscany.core.wire.TargetWireFactory;
-import org.apache.tuscany.core.wire.SourceWireFactory;
-import org.apache.tuscany.model.assembly.AssemblyObject;
-
-/**
- * A mock configuration context
- *
- * @version $Rev: 368822 $ $Date: 2006-01-13 10:54:38 -0800 (Fri, 13 Jan 2006) $
- */
-public class MockConfigContext implements ConfigurationContext {
-
- private List<ContextFactoryBuilder> builders;
-
- private DefaultWireBuilder wireBuilder = new DefaultWireBuilder();
-
- public MockConfigContext(List<ContextFactoryBuilder> builders, List<WireBuilder> wireBuilders) {
- this.builders = (builders == null) ? new ArrayList(1) : builders;
- if (wireBuilders != null){
- for (WireBuilder builder : wireBuilders) {
- wireBuilder.addWireBuilder(builder);
- }
- }
- }
-
- public void build(AssemblyObject model) throws BuilderConfigException {
- AssemblyVisitorImpl visitor = new AssemblyVisitorImpl(builders);
- visitor.start(model);
- }
-
- public void connect(SourceWireFactory sourceFactory, TargetWireFactory targetFactory, Class targetType, boolean downScope,
- ScopeContext targetScopeContext) throws BuilderConfigException {
- wireBuilder.connect(sourceFactory, targetFactory, targetType, downScope, targetScopeContext);
- }
-
- public void completeTargetChain(TargetWireFactory targetFactory, Class targetType, ScopeContext targetScopeContext) throws BuilderConfigException {
- wireBuilder.completeTargetChain(targetFactory, targetType, targetScopeContext);
- }
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockContextFactory.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockContextFactory.java
deleted file mode 100644
index 4e00e4c236..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockContextFactory.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock;
-
-import org.apache.tuscany.container.java.assembly.JavaAssemblyFactory;
-import org.apache.tuscany.container.java.assembly.impl.JavaAssemblyFactoryImpl;
-import org.apache.tuscany.container.java.config.JavaContextFactory;
-import org.apache.tuscany.container.java.scopes.OrderedDependentPojo;
-import org.apache.tuscany.core.builder.ContextFactory;
-import org.apache.tuscany.core.builder.ObjectFactory;
-import org.apache.tuscany.core.config.JavaIntrospectionHelper;
-import org.apache.tuscany.core.context.Context;
-import org.apache.tuscany.core.context.ScopeContext;
-import org.apache.tuscany.core.injection.Injector;
-import org.apache.tuscany.core.injection.MethodInjector;
-import org.apache.tuscany.core.injection.ObjectCreationException;
-import org.apache.tuscany.core.injection.EventInvoker;
-import org.apache.tuscany.core.injection.MethodEventInvoker;
-import org.apache.tuscany.model.assembly.AssemblyContext;
-import org.apache.tuscany.model.assembly.Scope;
-import org.apache.tuscany.model.assembly.impl.AssemblyContextImpl;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @version $$Rev$$ $$Date$$
- */
-public class MockContextFactory {
-
- private MockContextFactory(){}
-
- /**
- * Wires together a source and target
- * @throws NoSuchMethodException
- */
- public static List<ContextFactory<Context>> createWiredContexts(Scope scope, ScopeContext context) throws NoSuchMethodException{
-
- Constructor constructor = JavaIntrospectionHelper.getDefaultConstructor(OrderedDependentPojo.class);
- Method getPojo = OrderedDependentPojo.class.getMethod("setPojo",OrderedDependentPojo.class);
- Method init = OrderedDependentPojo.class.getMethod("init",(Class[])null);
- EventInvoker<Object> initInvoker = new MethodEventInvoker<Object>(init);
- Method destroy = OrderedDependentPojo.class.getMethod("destroy",(Class[])null);
- EventInvoker<Object> destroyInvoker = new MethodEventInvoker<Object>(destroy);
-
- JavaContextFactory source = new JavaContextFactory("source",constructor,scope);
- source.setInitInvoker(initInvoker);
- source.setDestroyInvoker(destroyInvoker);
- JavaContextFactory target = new JavaContextFactory("target",constructor,scope);
- target.setInitInvoker(initInvoker);
- target.setDestroyInvoker(destroyInvoker);
- List<Injector> injectors = new ArrayList<Injector>();
- injectors.add(new MethodInjector(getPojo, new MockTargetFactory("target",context)));
- source.setSetters(injectors);
- List<ContextFactory<Context>> list = new ArrayList<ContextFactory<Context>>();
- list.add((ContextFactory)source);
- list.add((ContextFactory)target);
- return list;
- }
-
- private static class MockTargetFactory implements ObjectFactory{
-
- private String name;
- private ScopeContext context;
-
- public MockTargetFactory (String name, ScopeContext context){
- this.name = name;
- this.context = context;
- }
-
- public Object getInstance() throws ObjectCreationException {
- return context.getContext(name).getInstance(null);
- }
- }
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockFactory.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockFactory.java
deleted file mode 100644
index 3b45352865..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockFactory.java
+++ /dev/null
@@ -1,819 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import junit.framework.Assert;
-import org.apache.tuscany.common.monitor.MonitorFactory;
-import org.apache.tuscany.common.monitor.impl.NullMonitorFactory;
-import org.apache.tuscany.container.java.assembly.JavaAssemblyFactory;
-import org.apache.tuscany.container.java.assembly.JavaImplementation;
-import org.apache.tuscany.container.java.assembly.impl.JavaAssemblyFactoryImpl;
-import org.apache.tuscany.container.java.assembly.mock.HelloWorldImpl;
-import org.apache.tuscany.container.java.assembly.mock.HelloWorldService;
-import org.apache.tuscany.container.java.builder.JavaContextFactoryBuilder;
-import org.apache.tuscany.container.java.builder.JavaTargetWireBuilder;
-import org.apache.tuscany.container.java.context.JavaAtomicContext;
-import org.apache.tuscany.container.java.mock.binding.foo.FooBinding;
-import org.apache.tuscany.container.java.mock.binding.foo.FooBindingBuilder;
-import org.apache.tuscany.container.java.mock.binding.foo.FooBindingWireBuilder;
-import org.apache.tuscany.container.java.mock.components.GenericComponent;
-import org.apache.tuscany.container.java.mock.components.HelloWorldClient;
-import org.apache.tuscany.container.java.mock.components.ModuleScopeComponent;
-import org.apache.tuscany.container.java.mock.components.ModuleScopeComponentImpl;
-import org.apache.tuscany.container.java.mock.components.OtherTarget;
-import org.apache.tuscany.container.java.mock.components.OtherTargetImpl;
-import org.apache.tuscany.container.java.mock.components.Source;
-import org.apache.tuscany.container.java.mock.components.SourceImpl;
-import org.apache.tuscany.container.java.mock.components.Target;
-import org.apache.tuscany.container.java.mock.components.TargetImpl;
-import org.apache.tuscany.core.builder.BuilderException;
-import org.apache.tuscany.core.builder.ContextFactory;
-import org.apache.tuscany.core.builder.ContextFactoryBuilder;
-import org.apache.tuscany.core.builder.ContextFactoryBuilderRegistry;
-import org.apache.tuscany.core.builder.WireBuilder;
-import org.apache.tuscany.core.builder.impl.DefaultWireBuilder;
-import org.apache.tuscany.core.builder.system.DefaultPolicyBuilderRegistry;
-import org.apache.tuscany.core.builder.system.PolicyBuilderRegistry;
-import org.apache.tuscany.core.client.BootstrapHelper;
-import org.apache.tuscany.core.config.ComponentTypeIntrospector;
-import org.apache.tuscany.core.config.ConfigurationException;
-import org.apache.tuscany.core.config.ConfigurationLoadException;
-import org.apache.tuscany.core.config.JavaIntrospectionHelper;
-import org.apache.tuscany.core.config.processor.ProcessorUtils;
-import org.apache.tuscany.core.context.CompositeContext;
-import org.apache.tuscany.core.context.Context;
-import org.apache.tuscany.core.context.SystemCompositeContext;
-import org.apache.tuscany.core.context.event.ModuleStart;
-import org.apache.tuscany.core.context.impl.CompositeContextImpl;
-import org.apache.tuscany.core.injection.EventInvoker;
-import org.apache.tuscany.core.injection.FieldInjector;
-import org.apache.tuscany.core.injection.Injector;
-import org.apache.tuscany.core.injection.MethodEventInvoker;
-import org.apache.tuscany.core.injection.MethodInjector;
-import org.apache.tuscany.core.injection.PojoObjectFactory;
-import org.apache.tuscany.core.injection.SingletonObjectFactory;
-import org.apache.tuscany.core.message.MessageFactory;
-import org.apache.tuscany.core.message.impl.MessageFactoryImpl;
-import org.apache.tuscany.core.runtime.RuntimeContext;
-import org.apache.tuscany.core.runtime.RuntimeContextImpl;
-import org.apache.tuscany.core.system.assembly.SystemAssemblyFactory;
-import org.apache.tuscany.core.system.assembly.SystemBinding;
-import org.apache.tuscany.core.system.assembly.impl.SystemAssemblyFactoryImpl;
-import org.apache.tuscany.core.system.builder.SystemContextFactoryBuilder;
-import org.apache.tuscany.core.system.builder.SystemEntryPointBuilder;
-import org.apache.tuscany.core.system.builder.SystemExternalServiceBuilder;
-import org.apache.tuscany.core.system.context.SystemCompositeContextImpl;
-import org.apache.tuscany.core.wire.WireFactoryFactory;
-import org.apache.tuscany.core.wire.jdk.JDKWireFactoryFactory;
-import org.apache.tuscany.core.wire.service.DefaultWireFactoryService;
-import org.apache.tuscany.model.assembly.AssemblyContext;
-import org.apache.tuscany.model.assembly.AtomicComponent;
-import org.apache.tuscany.model.assembly.Component;
-import org.apache.tuscany.model.assembly.ComponentType;
-import org.apache.tuscany.model.assembly.ConfiguredReference;
-import org.apache.tuscany.model.assembly.ConfiguredService;
-import org.apache.tuscany.model.assembly.EntryPoint;
-import org.apache.tuscany.model.assembly.ExternalService;
-import org.apache.tuscany.model.assembly.Module;
-import org.apache.tuscany.model.assembly.Multiplicity;
-import org.apache.tuscany.model.assembly.Reference;
-import org.apache.tuscany.model.assembly.Scope;
-import org.apache.tuscany.model.assembly.Service;
-import org.apache.tuscany.model.assembly.impl.AssemblyContextImpl;
-import org.apache.tuscany.model.types.java.JavaServiceContract;
-import org.osoa.sca.annotations.ComponentName;
-import org.osoa.sca.annotations.Destroy;
-import org.osoa.sca.annotations.Init;
-
-/**
- * Generates test components, modules, and runtime artifacts
- *
- * @version $Rev$ $Date$
- */
-public class MockFactory {
-
- public static final String JAVA_BUILDER = "java.runtime.builder";
- public static final String MESSAGE_FACTORY = "java.runtime.messageFactory";
- public static final String PROXY_FACTORY_FACTORY = "java.runtime.wireFactoryFactory";
- public static final String WIRE_FACTORY_SERVICE = "java.runtime.wireFactoryservice";
- public static final String JAVA_WIRE_BUILDER = "java.wire.builder";
- public static final String FOO_BUILDER = "foo.binding.builder";
- public static final String FOO_WIRE_BUILDER = "foo.binding.wire.builder";
- public static final String POLICY_BUILDER_REGISTRY = "foo.binding.policy.registry";
- public static final String SYSTEM_CHILD = "tuscany.system.child";
-
- private static JavaAssemblyFactory factory = new JavaAssemblyFactoryImpl();
- private static SystemAssemblyFactory systemFactory = new SystemAssemblyFactoryImpl();
- private static AssemblyContext assemblyContext = new AssemblyContextImpl(null, null);
- private static ComponentTypeIntrospector introspector;
- private static ComponentType systemComponentType;
- private static ComponentType compositeComponentType;
-
- public static ComponentType getComponentType() throws ConfigurationLoadException {
- if (systemComponentType == null) {
- systemComponentType = getIntrospector().introspect(SystemCompositeContextImpl.class);
- }
- return systemComponentType;
- }
-
- public static ComponentType getCompositeComponentType() throws ConfigurationLoadException {
- if (compositeComponentType == null) {
- compositeComponentType = getIntrospector().introspect(CompositeContextImpl.class);
- }
- return compositeComponentType;
- }
-
- public static ComponentTypeIntrospector getIntrospector() {
- if (introspector == null) {
- introspector = ProcessorUtils.createCoreIntrospector(systemFactory);
- }
- return introspector;
- }
-
- /**
- * Creates an initialized simple component
- *
- * @param name the component name
- * @param type the implementation type
- * @param scope the component scope
- */
- public static AtomicComponent createComponent(String name, Class type, Scope scope) throws ConfigurationLoadException {
- AtomicComponent sc = factory.createSimpleComponent();
- JavaImplementation impl = factory.createJavaImplementation();
- impl.setComponentType(getIntrospector().introspect(type));
- impl.setImplementationClass(type);
- sc.setImplementation(impl);
- Service s = factory.createService();
- JavaServiceContract ji = factory.createJavaServiceContract();
- ji.setInterface(type);
- s.setServiceContract(ji);
- ji.setScope(scope);
- impl.getComponentType().getServices().add(s);
- sc.setName(name);
- sc.setImplementation(impl);
- return sc;
- }
-
- public static AtomicComponent createNonIntrospectedComponent(String name, Class service, Class type, Scope scope) throws ConfigurationLoadException {
- AtomicComponent sc = factory.createSimpleComponent();
- JavaImplementation impl = factory.createJavaImplementation();
- impl.setComponentType(factory.createComponentType());
- impl.setImplementationClass(type);
- sc.setImplementation(impl);
- Service s = factory.createService();
- JavaServiceContract ji = factory.createJavaServiceContract();
- ji.setInterface(service);
- s.setServiceContract(ji);
- ji.setScope(scope);
- impl.getComponentType().getServices().add(s);
- sc.setName(name);
- sc.setImplementation(impl);
- return sc;
- }
-
-
- /**
- * Creates an composite component with the given name
- */
- public static Component createCompositeComponent(String name) throws ConfigurationLoadException {
- Component sc = systemFactory.createModuleComponent();
- Module impl = systemFactory.createModule();
- impl.setName(name);
- //impl.setImplementationClass(CompositeContextImpl.class);
- sc.setImplementation(impl);
- Service s = systemFactory.createService();
- JavaServiceContract ji = systemFactory.createJavaServiceContract();
- s.setServiceContract(ji);
- ji.setScope(Scope.AGGREGATE);
- //impl.setComponentType(systemFactory.createComponentType());
- impl.setImplementationClass(CompositeContextImpl.class);
- impl.setComponentType(getCompositeComponentType());
- impl.getComponentType().getServices().add(s);
- sc.setName(name);
- sc.setImplementation(impl);
-
- return sc;
- }
-
- /**
- * Creates a system composite component with the given name
- */
- public static Component createSystemCompositeComponent(String name) throws ConfigurationLoadException {
- Component sc = systemFactory.createModuleComponent();
- Module impl = systemFactory.createSystemModule();
- impl.setName(name);
- //impl.setImplementationClass(SystemCompositeContextImpl.class);
- sc.setImplementation(impl);
- Service s = systemFactory.createService();
- JavaServiceContract ji = systemFactory.createJavaServiceContract();
- s.setServiceContract(ji);
- ji.setScope(Scope.AGGREGATE);
- impl.setComponentType(getComponentType());
- //impl.setComponentType(systemFactory.createComponentType());
- impl.getComponentType().getServices().add(s);
- sc.setName(name);
- sc.setImplementation(impl);
- return sc;
- }
-
- /**
- * Creates an external service configured with the 'Foo' test binding
- */
- public static ExternalService createFooBindingExternalService(String name, Class interfaz) {
- ExternalService es = factory.createExternalService();
- es.setName(name);
- Service s = factory.createService();
- JavaServiceContract ji = factory.createJavaServiceContract();
- ji.setScope(Scope.MODULE);
- ji.setInterface(interfaz);
- s.setServiceContract(ji);
- ConfiguredService configuredService = factory.createConfiguredService();
- es.setConfiguredService(configuredService);
-
- FooBinding binding = new FooBinding();
- es.getBindings().add(binding);
- return es;
- }
-
- /**
- * Creates an entry point with the given name configured with the given interface and the {@link
- * FooBinding}
- */
- public static EntryPoint createFooBindingEntryPoint(String name, Class interfaz) {
- EntryPoint ep = factory.createEntryPoint();
- ep.setName(name);
- Service s = factory.createService();
- JavaServiceContract ji = factory.createJavaServiceContract();
- ji.setScope(Scope.MODULE);
- ji.setInterface(interfaz);
- s.setServiceContract(ji);
- ConfiguredService configuredService = factory.createConfiguredService();
- configuredService.setPort(s);
- ep.setConfiguredService(configuredService);
- FooBinding binding = new FooBinding();
- ep.getBindings().add(binding);
- return ep;
- }
-
- /**
- * Creates an external service configured with a {@link SystemBinding}
- */
- public static ExternalService createESSystemBinding(String name, String refName) {
- ExternalService es = systemFactory.createExternalService();
- es.setName(name);
- ConfiguredService configuredService = systemFactory.createConfiguredService();
- es.setConfiguredService(configuredService);
- SystemBinding binding = systemFactory.createSystemBinding();
- binding.setTargetName(refName);
- es.getBindings().add(binding);
- es.initialize(null);
- return es;
- }
-
- /**
- * Creates a module with a Java-based "target" module-scoped component wired to a module-scoped "source"
- */
- public static Module createModule() throws ConfigurationLoadException {
- return createModule(Scope.MODULE, Scope.MODULE);
- }
-
- /**
- * Creates a module with a Java-based "target" component wired to a "source"
- */
- public static Module createModule(Scope sourceScope, Scope targetScope) throws ConfigurationLoadException {
- Component sourceComponent = createNonIntrospectedComponent("source", ModuleScopeComponent.class, ModuleScopeComponentImpl.class, sourceScope);
- Component targetComponent = createNonIntrospectedComponent("target", ModuleScopeComponent.class, ModuleScopeComponentImpl.class, targetScope);
-
- Service targetService = factory.createService();
- JavaServiceContract targetContract = factory.createJavaServiceContract();
- targetContract.setInterface(GenericComponent.class);
- targetService.setServiceContract(targetContract);
- targetService.setName("GenericComponent");
- targetContract.setScope(targetScope);
- ConfiguredService cTargetService = factory.createConfiguredService();
- cTargetService.setPort(targetService);
- cTargetService.initialize(assemblyContext);
- targetComponent.getConfiguredServices().add(cTargetService);
- targetComponent.initialize(assemblyContext);
-
- Reference ref = factory.createReference();
- ref.setName("setGenericComponent");
- JavaServiceContract inter = factory.createJavaServiceContract();
- inter.setInterface(GenericComponent.class);
- ref.setServiceContract(inter);
- sourceComponent.getImplementation().getComponentType().getReferences().add(ref);
-
- ConfiguredReference cref = factory.createConfiguredReference("setGenericComponent", "target");
- cref.initialize(assemblyContext);
- sourceComponent.getConfiguredReferences().add(cref);
- sourceComponent.initialize(assemblyContext);
-
- Module module = factory.createModule();
- module.setName("test.module");
- module.getComponents().add(sourceComponent);
- module.getComponents().add(targetComponent);
- module.initialize(assemblyContext);
- return module;
- }
-
- /**
- * Creates a module with a Java-based source component wired to a "target" external service configured
- * with the {@link FooBinding}
- */
- public static Module createModuleWithExternalService() throws ConfigurationLoadException {
- Component sourceComponent = createComponent("source", HelloWorldClient.class, Scope.MODULE);
- ExternalService targetES = createFooBindingExternalService("target", HelloWorldService.class);
-
- Service targetService = factory.createService();
- JavaServiceContract targetContract = factory.createJavaServiceContract();
- targetContract.setInterface(HelloWorldService.class);
- targetService.setServiceContract(targetContract);
- targetService.setName("HelloWorld");
- ConfiguredService cTargetService = factory.createConfiguredService();
- cTargetService.setPort(targetService);
- targetES.setConfiguredService(cTargetService);
- targetES.initialize(assemblyContext);
-
- Reference ref = factory.createReference();
- ref.setName("setHelloWorldService");
- JavaServiceContract inter = factory.createJavaServiceContract();
- inter.setInterface(HelloWorldService.class);
- ref.setServiceContract(inter);
- sourceComponent.getImplementation().getComponentType().getReferences().add(ref);
-
- ConfiguredReference cref = factory.createConfiguredReference(ref.getName(), "target");
- cref.initialize(assemblyContext);
- sourceComponent.getConfiguredReferences().add(cref);
- sourceComponent.initialize(assemblyContext);
-
- Module module = factory.createModule();
- module.setName("test.module");
- module.getComponents().add(sourceComponent);
- module.getExternalServices().add(targetES);
- module.initialize(assemblyContext);
- return module;
- }
-
- /**
- * Creates a module with an entry point named "source" configured with the {@link FooBinding} wired to a
- * service offered by a Java-based component named "target"
- *
- * @param scope the scope of the target service
- */
- public static Module createModuleWithEntryPoint(Scope scope) throws ConfigurationLoadException {
- Component targetComponent = createComponent("target", HelloWorldImpl.class, scope);
-
- Service targetService = factory.createService();
- JavaServiceContract targetContract = factory.createJavaServiceContract();
- targetContract.setInterface(HelloWorldService.class);
- targetService.setServiceContract(targetContract);
- targetService.setName("HelloWorldService");
- ConfiguredService cTargetService = factory.createConfiguredService();
- cTargetService.setPort(targetService);
- targetComponent.getConfiguredServices().add(cTargetService);
- targetComponent.initialize(assemblyContext);
-
- Reference ref = factory.createReference();
- ConfiguredReference cref = factory.createConfiguredReference();
- ref.setName("setHelloWorldService");
- JavaServiceContract inter = factory.createJavaServiceContract();
- inter.setInterface(HelloWorldService.class);
- ref.setServiceContract(inter);
- cref.setPort(ref);
- cref.getTargetConfiguredServices().add(cTargetService);
- cref.initialize(assemblyContext);
-
- EntryPoint sourceEP = createFooBindingEntryPoint("source", HelloWorldService.class);
- sourceEP.setConfiguredReference(cref);
- sourceEP.getConfiguredService().getPort().setName("HelloWorldService");
- sourceEP.initialize(assemblyContext);
-
- Module module = factory.createModule();
- module.setName("test.module");
- module.getEntryPoints().add(sourceEP);
- module.getComponents().add(targetComponent);
- module.setImplementationClass(CompositeContextImpl.class);
- module.setComponentType(getCompositeComponentType());
- module.initialize(assemblyContext);
- return module;
- }
-
- /**
- * Creates a module with an entry point wired to a "target" external service configured with the {@link
- * FooBinding}
- */
- public static Module createModuleWithEntryPointToExternalService() {
- //Component sourceComponent = createComponent("source", HelloWorldClient.class, Scope.MODULE);
-
- EntryPoint sourceEP = createFooBindingEntryPoint("source", HelloWorldService.class);
- sourceEP.getConfiguredService().getPort().setName("HelloWorldService");
- sourceEP.initialize(assemblyContext);
-
-
- ExternalService targetES = createFooBindingExternalService("target", HelloWorldService.class);
-
- Service targetService = factory.createService();
- JavaServiceContract targetContract = factory.createJavaServiceContract();
- targetContract.setInterface(HelloWorldService.class);
- targetService.setServiceContract(targetContract);
- targetService.setName("HelloWorld");
- ConfiguredService cTargetService = factory.createConfiguredService();
- cTargetService.setPort(targetService);
- targetES.setConfiguredService(cTargetService);
- targetES.initialize(assemblyContext);
-
- Reference ref = factory.createReference();
- ref.setName("setHelloWorldService");
- JavaServiceContract inter = factory.createJavaServiceContract();
- inter.setInterface(HelloWorldService.class);
- ref.setServiceContract(inter);
-
-
- ConfiguredReference cref = factory.createConfiguredReference(ref.getName(), "target");
- cref.setPort(ref);
- cref.initialize(assemblyContext);
- sourceEP.setConfiguredReference(cref);
- sourceEP.initialize(assemblyContext);
-
- Module module = factory.createModule();
- module.setName("test.module");
- module.getEntryPoints().add(sourceEP);
- module.getExternalServices().add(targetES);
- module.initialize(assemblyContext);
- return module;
- }
-
-
- /**
- * Creates a test system module with source and target components wired together.
- *
- * @see org.apache.tuscany.core.mock.component.Source
- * @see org.apache.tuscany.core.mock.component.Target
- */
-
- public static Module createModuleWithWiredComponents(Scope sourceScope, Scope targetScope) {
-
- // create the target component
- AtomicComponent target = factory.createSimpleComponent();
- target.setName("target");
- JavaImplementation targetImpl = factory.createJavaImplementation();
- targetImpl.setComponentType(factory.createComponentType());
- targetImpl.setImplementationClass(TargetImpl.class);
- target.setImplementation(targetImpl);
- Service targetService = factory.createService();
- JavaServiceContract targetContract = factory.createJavaServiceContract();
- targetContract.setInterface(Target.class);
- targetService.setServiceContract(targetContract);
- targetService.setName("Target");
- targetImpl.getComponentType().getServices().add(targetService);
- targetContract.setScope(targetScope);
- ConfiguredService cTargetService = factory.createConfiguredService();
- cTargetService.setPort(targetService);
- cTargetService.initialize(assemblyContext);
- target.getConfiguredServices().add(cTargetService);
- target.initialize(assemblyContext);
-
- // create the source component
- AtomicComponent source = factory.createSimpleComponent();
- ComponentType componentType = factory.createComponentType();
- source.setName("source");
- JavaImplementation impl = factory.createJavaImplementation();
- impl.setComponentType(componentType);
- impl.setImplementationClass(SourceImpl.class);
- source.setImplementation(impl);
- Service s = systemFactory.createService();
- JavaServiceContract contract = systemFactory.createJavaServiceContract();
- contract.setInterface(Source.class);
- s.setServiceContract(contract);
- contract.setScope(sourceScope);
- impl.getComponentType().getServices().add(s);
- source.setImplementation(impl);
-
- // wire source to target
- JavaServiceContract refContract = systemFactory.createJavaServiceContract();
- refContract.setInterface(Target.class);
- Reference reference = systemFactory.createReference();
- reference.setName("setTarget");
- reference.setServiceContract(refContract);
- componentType.getReferences().add(reference);
- ConfiguredReference cReference = systemFactory.createConfiguredReference(reference.getName(), "target");
- cReference.initialize(assemblyContext);
- source.getConfiguredReferences().add(cReference);
-
- // wire multiplicity using a setter
- JavaServiceContract refContract2 = systemFactory.createJavaServiceContract();
- refContract2.setInterface(Target.class);
- Reference reference2 = systemFactory.createReference();
- reference2.setName("setTargets");
- reference2.setServiceContract(refContract2);
- reference2.setMultiplicity(Multiplicity.ONE_N);
- componentType.getReferences().add(reference2);
- ConfiguredReference cReference2 = systemFactory.createConfiguredReference(reference2.getName(), "target");
- cReference2.initialize(assemblyContext);
- source.getConfiguredReferences().add(cReference2);
-
- // wire multiplicity using a field
- JavaServiceContract refContract3 = systemFactory.createJavaServiceContract();
- refContract3.setInterface(Target.class);
- Reference reference3 = systemFactory.createReference();
- reference3.setName("targetsThroughField");
- reference3.setServiceContract(refContract3);
- reference3.setMultiplicity(Multiplicity.ONE_N);
- componentType.getReferences().add(reference3);
- ConfiguredReference cReference3 = systemFactory.createConfiguredReference(reference3.getName(), "target");
- cReference3.initialize(assemblyContext);
- source.getConfiguredReferences().add(cReference3);
-
- // wire multiplicity using a array
- JavaServiceContract refContract4 = systemFactory.createJavaServiceContract();
- refContract4.setInterface(Target.class);
- Reference reference4 = systemFactory.createReference();
- reference4.setName("setArrayOfTargets");
- reference4.setServiceContract(refContract4);
- reference4.setMultiplicity(Multiplicity.ONE_N);
- componentType.getReferences().add(reference4);
- ConfiguredReference cReference4 = systemFactory.createConfiguredReference(reference4.getName(), "target");
- cReference4.initialize(assemblyContext);
- source.getConfiguredReferences().add(cReference4);
-
- source.initialize(assemblyContext);
-
- Module module = systemFactory.createModule();
- module.setName("system.module");
-
- module.getComponents().add(source);
- module.getComponents().add(target);
- module.initialize(assemblyContext);
- return module;
- }
-
-
- /**
- * Creates a test system module with source and target components wired together.
- *
- * @see org.apache.tuscany.core.mock.component.Source
- * @see org.apache.tuscany.core.mock.component.Target
- */
-
- public static Module createModuleWithWiredComponentsOfDifferentInterface(Scope sourceScope, Scope targetScope) {
-
- // create the target component
- AtomicComponent target = factory.createSimpleComponent();
- target.setName("target");
- JavaImplementation targetImpl = factory.createJavaImplementation();
- targetImpl.setComponentType(factory.createComponentType());
- targetImpl.setImplementationClass(OtherTargetImpl.class);
- target.setImplementation(targetImpl);
- Service targetService = factory.createService();
- JavaServiceContract targetContract = factory.createJavaServiceContract();
- targetContract.setInterface(OtherTarget.class);
- targetService.setServiceContract(targetContract);
- targetService.setName("Target");
- targetImpl.getComponentType().getServices().add(targetService);
- targetContract.setScope(targetScope);
- ConfiguredService cTargetService = factory.createConfiguredService();
- cTargetService.setPort(targetService);
- cTargetService.initialize(assemblyContext);
- target.getConfiguredServices().add(cTargetService);
- target.initialize(assemblyContext);
-
- // create the source component
- AtomicComponent source = factory.createSimpleComponent();
- ComponentType componentType = factory.createComponentType();
- source.setName("source");
- JavaImplementation impl = factory.createJavaImplementation();
- impl.setComponentType(componentType);
- impl.setImplementationClass(SourceImpl.class);
- source.setImplementation(impl);
- Service s = systemFactory.createService();
- JavaServiceContract contract = systemFactory.createJavaServiceContract();
- contract.setInterface(Source.class);
- s.setServiceContract(contract);
- contract.setScope(sourceScope);
- impl.getComponentType().getServices().add(s);
- source.setImplementation(impl);
-
- // wire source to target
- JavaServiceContract refContract = systemFactory.createJavaServiceContract();
- refContract.setInterface(Target.class);
- Reference reference = systemFactory.createReference();
- reference.setName("setTarget");
- reference.setServiceContract(refContract);
- componentType.getReferences().add(reference);
- ConfiguredReference cReference = systemFactory.createConfiguredReference(reference.getName(), "target");
- cReference.initialize(assemblyContext);
- source.getConfiguredReferences().add(cReference);
-
- // wire multiplicity using a setter
- JavaServiceContract refContract2 = systemFactory.createJavaServiceContract();
- refContract2.setInterface(Target.class);
- Reference reference2 = systemFactory.createReference();
- reference2.setName("setTargets");
- reference2.setServiceContract(refContract2);
- reference2.setMultiplicity(Multiplicity.ONE_N);
- componentType.getReferences().add(reference2);
- ConfiguredReference cReference2 = systemFactory.createConfiguredReference(reference2.getName(), "target");
- cReference2.initialize(assemblyContext);
- source.getConfiguredReferences().add(cReference2);
-
- // wire multiplicity using a field
- JavaServiceContract refContract3 = systemFactory.createJavaServiceContract();
- refContract3.setInterface(Target.class);
- Reference reference3 = systemFactory.createReference();
- reference3.setName("targetsThroughField");
- reference3.setServiceContract(refContract3);
- reference3.setMultiplicity(Multiplicity.ONE_N);
- componentType.getReferences().add(reference3);
- ConfiguredReference cReference3 = systemFactory.createConfiguredReference(reference3.getName(), "target");
- cReference3.initialize(assemblyContext);
- source.getConfiguredReferences().add(cReference3);
-
- // wire multiplicity using a array
- JavaServiceContract refContract4 = systemFactory.createJavaServiceContract();
- refContract4.setInterface(Target.class);
- Reference reference4 = systemFactory.createReference();
- reference4.setName("setArrayOfTargets");
- reference4.setServiceContract(refContract4);
- reference4.setMultiplicity(Multiplicity.ONE_N);
- componentType.getReferences().add(reference4);
- ConfiguredReference cReference4 = systemFactory.createConfiguredReference(reference4.getName(), "target");
- cReference4.initialize(assemblyContext);
- source.getConfiguredReferences().add(cReference4);
-
- source.initialize(assemblyContext);
-
- Module module = systemFactory.createModule();
- module.setName("system.module");
-
- module.getComponents().add(source);
- module.getComponents().add(target);
- module.initialize(assemblyContext);
- return module;
- }
-
-
- /**
- * Returns a collection of bootstrap configuration builders
- */
- public static List<ContextFactoryBuilder> createSystemBuilders() {
- List<ContextFactoryBuilder> builders = new ArrayList<ContextFactoryBuilder>();
- builders.add((new SystemContextFactoryBuilder(null)));
- builders.add(new SystemEntryPointBuilder());
- builders.add(new SystemExternalServiceBuilder());
- return builders;
- }
-
- /**
- * Creates an composite context faxtory
- *
- * @param name the name of the component
- * @throws BuilderException
- * @see ContextFactory
- */
- public static ContextFactory<Context> createCompositeConfiguration(String name
- ) throws BuilderException, ConfigurationLoadException {
-
- Component sc = createCompositeComponent(name);
- SystemContextFactoryBuilder builder = new SystemContextFactoryBuilder(null);
- builder.build(sc);
- return (ContextFactory<Context>) sc.getContextFactory();
- }
-
- /**
- * Creates a Java POJO component context
- *
- * @param name the name of the context
- * @param implType the POJO class
- * @param scope the component scope
- * @param moduleComponentContext the containing composite context
- * @throws NoSuchMethodException if the POJO does not have a default noi-args constructor
- */
- public static JavaAtomicContext createPojoContext(String name, Class implType, Scope scope,
- CompositeContext moduleComponentContext) throws NoSuchMethodException, ConfigurationLoadException {
- AtomicComponent component = createComponent(name, implType, scope);
-
- Set<Field> fields = JavaIntrospectionHelper.getAllFields(implType);
- Set<Method> methods = JavaIntrospectionHelper.getAllUniqueMethods(implType);
- List<Injector> injectors = new ArrayList<Injector>();
-
- EventInvoker initInvoker = null;
- boolean eagerInit = false;
- EventInvoker destroyInvoker = null;
- for (Field field : fields) {
- ComponentName compName = field.getAnnotation(ComponentName.class);
- if (compName != null) {
- Injector injector = new FieldInjector(field, new SingletonObjectFactory(name));
- injectors.add(injector);
- }
- org.osoa.sca.annotations.Context context = field.getAnnotation(org.osoa.sca.annotations.Context.class);
- if (context != null) {
- Injector injector = new FieldInjector(field, new SingletonObjectFactory(moduleComponentContext));
- injectors.add(injector);
- }
- }
- for (Method method : methods) {
- // FIXME Java5
- Init init = method.getAnnotation(Init.class);
- if (init != null && initInvoker == null) {
- initInvoker = new MethodEventInvoker(method);
- eagerInit = init.eager();
- continue;
- }
- Destroy destroy = method.getAnnotation(Destroy.class);
- if (destroy != null && destroyInvoker == null) {
- destroyInvoker = new MethodEventInvoker(method);
- continue;
- }
- ComponentName compName = method.getAnnotation(ComponentName.class);
- if (compName != null) {
- Injector injector = new MethodInjector(method, new SingletonObjectFactory(name));
- injectors.add(injector);
- }
- org.osoa.sca.annotations.Context context = method.getAnnotation(org.osoa.sca.annotations.Context.class);
- if (context != null) {
- Injector injector = new MethodInjector(method, new SingletonObjectFactory(moduleComponentContext));
- injectors.add(injector);
- }
- }
- boolean stateless = (scope == Scope.INSTANCE);
- return new JavaAtomicContext("foo", new PojoObjectFactory(JavaIntrospectionHelper
- .getDefaultConstructor(implType), null, injectors), eagerInit, initInvoker, destroyInvoker, stateless);
- }
-
- /**
- * Creates a default {@link RuntimeContext} configured with support for Java component implementations
- *
- * @throws ConfigurationException
- */
- public static RuntimeContext createJavaRuntime() throws ConfigurationException {
- MonitorFactory monitorFactory = new NullMonitorFactory();
- ContextFactoryBuilderRegistry builderRegistry = BootstrapHelper.bootstrapContextFactoryBuilders(monitorFactory);
- DefaultWireBuilder wireBuilder = new DefaultWireBuilder();
- RuntimeContext runtime = new RuntimeContextImpl(monitorFactory, builderRegistry, wireBuilder);
- runtime.start();
- runtime.getSystemContext().registerModelObject(createSystemCompositeComponent(SYSTEM_CHILD));
- SystemCompositeContext ctx = (SystemCompositeContext) runtime.getSystemContext().getContext(SYSTEM_CHILD);
- Component comp = systemFactory.createSystemComponent(POLICY_BUILDER_REGISTRY, PolicyBuilderRegistry.class, DefaultPolicyBuilderRegistry.class, Scope.MODULE);
- comp.getImplementation().setComponentType(getIntrospector().introspect(DefaultPolicyBuilderRegistry.class));
- ctx.registerModelObject(comp);
- comp = systemFactory.createSystemComponent(MESSAGE_FACTORY, MessageFactory.class, MessageFactoryImpl.class, Scope.MODULE);
- comp.getImplementation().setComponentType(getIntrospector().introspect(MessageFactoryImpl.class));
- ctx.registerModelObject(comp);
- comp = systemFactory.createSystemComponent(PROXY_FACTORY_FACTORY, WireFactoryFactory.class, JDKWireFactoryFactory.class, Scope.MODULE);
- comp.getImplementation().setComponentType(getIntrospector().introspect(JDKWireFactoryFactory.class));
- ctx.registerModelObject(comp);
- comp = systemFactory.createSystemComponent(WIRE_FACTORY_SERVICE, org.apache.tuscany.core.wire.service.WireFactoryService.class, DefaultWireFactoryService.class, Scope.MODULE);
- comp.getImplementation().setComponentType(getIntrospector().introspect(DefaultWireFactoryService.class));
- ctx.registerModelObject(comp);
- comp = systemFactory.createSystemComponent(JAVA_BUILDER, ContextFactoryBuilder.class, JavaContextFactoryBuilder.class, Scope.MODULE);
- comp.getImplementation().setComponentType(getIntrospector().introspect(JavaContextFactoryBuilder.class));
- ctx.registerModelObject(comp);
- comp = systemFactory.createSystemComponent(JAVA_WIRE_BUILDER, WireBuilder.class, JavaTargetWireBuilder.class, Scope.MODULE);
- comp.getImplementation().setComponentType(getIntrospector().introspect(JavaTargetWireBuilder.class));
- ctx.registerModelObject(comp);
- ctx.publish(new ModuleStart(new Object()));
- return runtime;
- }
-
- /**
- * Registers the {@link FooBinding} builders with a given runtime
- *
- * @throws ConfigurationException
- */
- public static RuntimeContext registerFooBinding(RuntimeContext runtime) throws ConfigurationException {
- CompositeContext child = (CompositeContext) runtime.getSystemContext().getContext(MockFactory.SYSTEM_CHILD);
- child.getContext(MockFactory.JAVA_BUILDER).getInstance(null);
- Component comp = systemFactory.createSystemComponent(FOO_BUILDER, ContextFactoryBuilder.class, FooBindingBuilder.class, Scope.MODULE);
- comp.getImplementation().setComponentType(getIntrospector().introspect(FooBindingBuilder.class));
- child.registerModelObject(comp);
- comp = systemFactory.createSystemComponent(FOO_WIRE_BUILDER, WireBuilder.class, FooBindingWireBuilder.class, Scope.MODULE);
- comp.getImplementation().setComponentType(getIntrospector().introspect(FooBindingWireBuilder.class));
- child.registerModelObject(comp);
- // since the child context is already started, we need to manually retrieve the components to init them
- Assert.assertNotNull(child.getContext(FOO_BUILDER).getInstance(null));
- Assert.assertNotNull(child.getContext(FOO_WIRE_BUILDER).getInstance(null));
- return runtime;
- }
-
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockScopeContext.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockScopeContext.java
deleted file mode 100644
index fe128f19a7..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockScopeContext.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.container.java.invocation.mock.SimpleTargetImpl;
-import org.apache.tuscany.core.builder.ContextFactory;
-import org.apache.tuscany.core.context.AtomicContext;
-import org.apache.tuscany.core.context.Context;
-import org.apache.tuscany.core.context.ContextRuntimeException;
-import org.apache.tuscany.core.context.EventFilter;
-import org.apache.tuscany.core.context.QualifiedName;
-import org.apache.tuscany.core.context.RuntimeEventListener;
-import org.apache.tuscany.core.context.ScopeContext;
-import org.apache.tuscany.core.context.ScopeRuntimeException;
-import org.apache.tuscany.core.context.event.Event;
-import org.apache.tuscany.model.assembly.AtomicComponent;
-
-public class MockScopeContext implements ScopeContext {
-
- Map<String, Object> components;
-
- public MockScopeContext() {
- components = new HashMap<String, Object>();
- components.put("foo", new SimpleTargetImpl());
- components.put("bar", new SimpleTargetImpl());
- }
-
- public MockScopeContext(Map<String,Object> instances) {
- components = instances;
- }
-
-
- public void start() {
- }
-
- public void stop() {
- }
-
- public void publish(Event object) {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void addListener(RuntimeEventListener listener) throws ContextRuntimeException {
- }
-
- public void addListener(EventFilter filter, RuntimeEventListener listener) {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void removeListener(RuntimeEventListener listener) throws ContextRuntimeException {
- }
-
- public String getName() {
- return "Mock Scope Container";
- }
-
- public boolean isCacheable() {
- return false;
- }
-
- public int[] getEventTypes() {
- return null;
- }
-
- public AtomicContext getContext(String name) {
- return null;
- }
-
- public Object getInstance(QualifiedName name) throws ScopeRuntimeException {
- return components.get(name.getPartName());
- }
-
- public AtomicContext getContextByKey(String name, Object key) {
- return null;
- }
-
- public void setComponent(AtomicComponent component) throws ScopeRuntimeException {
- }
-
- public void removeContext(String name) throws ScopeRuntimeException {
- }
-
- public void removeContextByKey(String name, Object key) throws ScopeRuntimeException {
- }
-
- public AtomicComponent[] getComponents() {
- return null;
- }
-
- public void registerFactories(List<ContextFactory<Context>> configurations) {
- }
-
- public void registerFactory(ContextFactory<Context> configuration) {
- }
-
- public int getLifecycleState(){
- return RUNNING;
- }
-
-
- public void setLifecycleState(int state) {
- }
-
-
- public void setName(String name) {
- }
-
-
- public void onEvent(Event event) {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-}
-
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBinding.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBinding.java
deleted file mode 100644
index 49c59bc718..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBinding.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.binding.foo;
-
-import org.apache.tuscany.model.assembly.AssemblyContext;
-import org.apache.tuscany.model.assembly.AssemblyVisitor;
-import org.apache.tuscany.model.assembly.Binding;
-
-/**
- * Represents a mock binding that echoes back a single parameter
- *
- * @version $Rev$ $Date$
- */
-public class FooBinding implements Binding {
-
- public FooBinding() {
- }
-
- public String getURI() {
- return null;
- }
-
- public void setURI(String value) {
- }
-
- public void initialize(AssemblyContext modelContext) {
- }
-
- public void freeze() {
- }
-
- public boolean accept(AssemblyVisitor visitor) {
- return true;
- }
-
- private Object contextFactory;
-
- public void setContextFactory(Object factory) {
- contextFactory = factory;
- }
-
- public Object getContextFactory() {
- System.out.println("retting");
- return contextFactory;
- }
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBindingBuilder.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBindingBuilder.java
deleted file mode 100644
index 558a8ce2cf..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBindingBuilder.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.binding.foo;
-
-import org.apache.tuscany.core.builder.BuilderException;
-import org.apache.tuscany.core.builder.ContextFactoryBuilder;
-import org.apache.tuscany.core.builder.ContextFactoryBuilderRegistry;
-import org.apache.tuscany.core.builder.ObjectFactory;
-import org.apache.tuscany.core.extension.EntryPointContextFactory;
-import org.apache.tuscany.core.injection.ObjectCreationException;
-import org.apache.tuscany.core.message.MessageFactory;
-import org.apache.tuscany.core.system.annotation.Autowire;
-import org.apache.tuscany.core.wire.SourceWireFactory;
-import org.apache.tuscany.core.wire.TargetWireFactory;
-import org.apache.tuscany.core.wire.service.WireFactoryService;
-import org.apache.tuscany.model.assembly.AssemblyObject;
-import org.apache.tuscany.model.assembly.ConfiguredService;
-import org.apache.tuscany.model.assembly.EntryPoint;
-import org.apache.tuscany.model.assembly.ExternalService;
-import org.apache.tuscany.model.assembly.Service;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Scope;
-
-/**
- * Creates a <code>ContextFactoryBuilder</code> for an entry point or external service configured with the {@link FooBinding}
- *
- * @version $Rev$ $Date$
- */
-@Scope("MODULE")
-public class FooBindingBuilder implements ContextFactoryBuilder {
- private ContextFactoryBuilderRegistry builderRegistry;
-
- private MessageFactory messageFactory;
-
- private WireFactoryService wireFactoryService;
-
- public FooBindingBuilder(WireFactoryService wireFactoryService) {
- this.wireFactoryService = wireFactoryService;
- }
-
- public FooBindingBuilder() {
- }
-
- @Init(eager = true)
- public void init() {
- builderRegistry.register(this);
- }
-
- @Autowire
- public void setBuilderRegistry(ContextFactoryBuilderRegistry builderRegistry) {
- this.builderRegistry = builderRegistry;
- }
-
- @Autowire
- public void setWireFactoryService(WireFactoryService wireFactoryService) {
- this.wireFactoryService = wireFactoryService;
- }
-
-
- /**
- * Sets the factory used to construct wire messages
- *
- * @param msgFactory
- */
- @Autowire
- public void setMessageFactory(MessageFactory msgFactory) {
- this.messageFactory = msgFactory;
- }
-
- public void build(AssemblyObject object) throws BuilderException {
- if (object instanceof EntryPoint) {
- EntryPoint ep = (EntryPoint) object;
- if (ep.getBindings().size() < 1 || !(ep.getBindings().get(0) instanceof FooBinding)) {
- return;
- }
- EntryPointContextFactory contextFactory = new FooEntryPointContextFactory(ep.getName(), messageFactory);
- ConfiguredService configuredService = ep.getConfiguredService();
- Service service = configuredService.getPort();
- SourceWireFactory wireFactory = wireFactoryService.createSourceFactory(ep.getConfiguredReference()).get(0);
- contextFactory.addSourceWireFactory(service.getName(), wireFactory);
- ep.setContextFactory(contextFactory);
- } else if (object instanceof ExternalService) {
- ExternalService es = (ExternalService) object;
- if (es.getBindings().size() < 1 || !(es.getBindings().get(0) instanceof FooBinding)) {
- return;
- }
- FooExternalServiceContextFactory contextFactory = new FooExternalServiceContextFactory(es.getName(),
- new FooClientFactory());
- ConfiguredService configuredService = es.getConfiguredService();
- Service service = configuredService.getPort();
- TargetWireFactory wireFactory = wireFactoryService.createTargetFactory(configuredService);
- contextFactory.addTargetWireFactory(service.getName(), wireFactory);
- es.setContextFactory(contextFactory);
- }
- }
-
- private static class FooClientFactory implements ObjectFactory {
-
- public Object getInstance() throws ObjectCreationException {
- return new FooClient();
- }
- }
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBindingWireBuilder.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBindingWireBuilder.java
deleted file mode 100644
index e2592024f8..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooBindingWireBuilder.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.binding.foo;
-
-import org.apache.tuscany.core.builder.BuilderConfigException;
-import org.apache.tuscany.core.builder.WireBuilder;
-import org.apache.tuscany.core.context.ScopeContext;
-import org.apache.tuscany.core.runtime.RuntimeContext;
-import org.apache.tuscany.core.system.annotation.Autowire;
-import org.apache.tuscany.core.wire.SourceInvocationConfiguration;
-import org.apache.tuscany.core.wire.SourceWireFactory;
-import org.apache.tuscany.core.wire.TargetInvocationConfiguration;
-import org.apache.tuscany.core.wire.TargetInvoker;
-import org.apache.tuscany.core.wire.TargetWireFactory;
-import org.osoa.sca.annotations.Init;
-
-public class FooBindingWireBuilder implements WireBuilder {
-
- public FooBindingWireBuilder() {
- super();
- }
-
- private RuntimeContext runtimeContext;
-
- @Autowire
- public void setRuntimeContext(RuntimeContext context) {
- runtimeContext = context;
- }
-
- @Init(eager = true)
- public void init() {
- runtimeContext.addBuilder(this);
- }
-
-
- public void connect(SourceWireFactory sourceFactory, TargetWireFactory targetFactory, Class targetType, boolean downScope,
- ScopeContext targetScopeContext) throws BuilderConfigException {
- if (!FooExternalServiceContextFactory.class.isAssignableFrom(targetType)) {
- return;
- }
- for (SourceInvocationConfiguration sourceInvocationConfig : sourceFactory.getConfiguration().getInvocationConfigurations()
- .values()) {
- FooExternalServiceTargetInvoker invoker = new FooExternalServiceTargetInvoker(sourceFactory.getConfiguration().getTargetName()
- .getPartName());
- sourceInvocationConfig.setTargetInvoker(invoker);
- }
-
- }
-
- public void completeTargetChain(TargetWireFactory targetFactory, Class targetType, ScopeContext targetScopeContext)
- throws BuilderConfigException {
- if (FooExternalServiceContextFactory.class.isAssignableFrom(targetType)) {
- for (TargetInvocationConfiguration targetInvocationConfig : targetFactory.getConfiguration().getInvocationConfigurations()
- .values()) {
- TargetInvoker invoker = new FooExternalServiceTargetInvoker(targetFactory.getConfiguration().getTargetName().getQualifiedName());
- targetInvocationConfig.setTargetInvoker(invoker);
- }
-
- }
- }
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooClient.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooClient.java
deleted file mode 100644
index 9f67eb7786..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooClient.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.binding.foo;
-
-import java.lang.reflect.Array;
-
-import org.apache.tuscany.core.context.TargetException;
-
-/**
- * A mock client for a transport binding
- *
- * @version $Rev$ $Date$
- */
-public class FooClient {
-
- public FooClient() {
- }
-
- public Object invoke(Object msg) {
- if (msg!=null && msg.getClass().isArray() && Array.getLength(msg) == 1){
- return Array.get(msg,0);
- }else{
- throw new TargetException("This binding only understands operations with a single parameter");
- }
- }
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooEntryPointContextFactory.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooEntryPointContextFactory.java
deleted file mode 100644
index 69d81f66be..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooEntryPointContextFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.binding.foo;
-
-import org.apache.tuscany.core.extension.EntryPointContextFactory;
-import org.apache.tuscany.core.message.MessageFactory;
-
-/**
- *
- *
- * @version $Rev$ $Date$
- */
-public class FooEntryPointContextFactory extends EntryPointContextFactory {
-
- public FooEntryPointContextFactory(String name, MessageFactory msgFactory) {
- super(name, msgFactory);
- }
-
-}
-
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooExternalServiceContextFactory.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooExternalServiceContextFactory.java
deleted file mode 100644
index c7f67e2ff2..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooExternalServiceContextFactory.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.binding.foo;
-
-import org.apache.tuscany.core.builder.ObjectFactory;
-import org.apache.tuscany.core.extension.ExternalServiceContextFactory;
-
-/**
- * Creates instances of {@link org.apache.tuscany.core.context.ExternalServiceContext} configured with the appropriate
- * wire chains and bindings. This implementation serves as a marker for
- * {@link org.apache.tuscany.container.java.mock.binding.foo.FooBindingWireBuilder}
- *
- * @version $Rev$ $Date$
- */
-public class FooExternalServiceContextFactory extends ExternalServiceContextFactory {
-
- public FooExternalServiceContextFactory(String name, ObjectFactory objectFactory) {
- super(name, objectFactory);
- }
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooExternalServiceTargetInvoker.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooExternalServiceTargetInvoker.java
deleted file mode 100644
index ecc9655a10..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/binding/foo/FooExternalServiceTargetInvoker.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.binding.foo;
-
-import org.apache.tuscany.core.context.ExternalServiceContext;
-import org.apache.tuscany.core.message.Message;
-import org.apache.tuscany.core.wire.Interceptor;
-import org.apache.tuscany.core.wire.TargetInvoker;
-
-import java.lang.reflect.InvocationTargetException;
-
-/**
- * Responsible for invoking a mock transport binding client configured for an external service over a wire
- *
- * @version $Rev$ $Date$
- */
-public class FooExternalServiceTargetInvoker implements TargetInvoker {
-
- private String name;
- private ExternalServiceContext context;
-
- public FooExternalServiceTargetInvoker(String esName) {
- assert (esName != null) : "No external service name specified";
- name = esName; // name is not used; it is included for illustration
- }
-
- public Object invokeTarget(Object payload) throws InvocationTargetException {
- FooClient client = new FooClient();
- if (payload != null) {
- return client.invoke(payload);
- } else {
- return client.invoke(null);
- }
- }
-
- public boolean isCacheable() {
- return false;
- }
-
- public Message invoke(Message msg) {
- try {
- Object resp = invokeTarget(msg.getBody());
- msg.setBody(resp);
- } catch (InvocationTargetException e) {
- msg.setBody(e.getCause());
- } catch (Throwable e) {
- msg.setBody(e);
- }
- return msg;
- }
-
- public void setNext(Interceptor next) {
- throw new UnsupportedOperationException();
- }
-
- public Object clone() throws CloneNotSupportedException {
- try {
- FooExternalServiceTargetInvoker invoker = (FooExternalServiceTargetInvoker) super.clone();
- invoker.context = this.context;
- invoker.name = this.name;
- return invoker;
- } catch (CloneNotSupportedException e) {
- return null; // will not happen
- }
- }
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/AbstractGenericComponent.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/AbstractGenericComponent.java
deleted file mode 100644
index 0c9d8172f8..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/AbstractGenericComponent.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import java.util.List;
-import java.util.Map;
-
-import org.osoa.sca.ModuleContext;
-import org.osoa.sca.annotations.ComponentName;
-import org.osoa.sca.annotations.Context;
-import org.osoa.sca.annotations.Property;
-
-/**
- * Base test component implementation
- *
- * @version $Rev$ $Date$
- */
-public class AbstractGenericComponent implements GenericComponent {
-
- @ComponentName
- private String name;
-
- public String getName() {
- return name;
- }
-
- @Context
- private ModuleContext context;
-
- public ModuleContext getModuleContext() {
- return context;
- }
-
- //----------------------------------
- // Collections
- //----------------------------------
-
- Map testMap;
-
- public Map getTestMap() {
- return testMap;
- }
-
- public void setTestMap(Map testMap) {
- this.testMap = testMap;
- }
-
- List testList;
-
- public List getTestList() {
- return testList;
- }
-
- public void setTestList(List testList) {
- this.testList = testList;
- }
-
- //----------------------------------
- // Arrays
- //----------------------------------
-
- private int[] arrayInt;
-
- public int[] getArrayInt() {
- return arrayInt;
- }
-
- public void setArrayInt(int[] arrayInt) {
- this.arrayInt = arrayInt;
- }
-
- private float[] arrayFloat;
-
- public float[] getArrayFloat() {
- return arrayFloat;
- }
-
- public void setArrayFloat(float[] pArrayFloat) {
- arrayFloat = pArrayFloat;
- }
-
- private double[] arrayDouble;
-
- public double[] getArrayDouble() {
- return arrayDouble;
- }
-
- public void setArrayDouble(double[] pArrayDouble) {
- arrayDouble = pArrayDouble;
- }
-
- private long[] arrayLong;
-
- public long[] getArrayLong() {
- return arrayLong;
- }
-
- public void setArrayLong(long[] arrayLong) {
- this.arrayLong = arrayLong;
- }
-
- private short[] arrayShort;
-
- public short[] getArrayShort() {
- return arrayShort;
- }
-
- public void setArrayShort(short[] arrayShort) {
- this.arrayShort = arrayShort;
- }
-
- private boolean[] arrayBoolean;
-
- public boolean[] getArrayBoolean() {
- return arrayBoolean;
- }
-
- public void setArrayBoolean(boolean[] arrayBoolean) {
- this.arrayBoolean = arrayBoolean;
- }
-
- private String[] arrayString;
-
- public String[] getArrayString() {
- return arrayString;
- }
-
- public void setArrayString(String[] arrayString) {
- this.arrayString = arrayString;
- }
-
- //----------------------------------
- // Primitives
- //----------------------------------
-
- private boolean mBoolean;
-
- public boolean getBoolean() {
- return mBoolean;
- }
-
- public void setBoolean(boolean pBoolean) {
- mBoolean = pBoolean;
- }
-
- private short mShort;
-
- public short getShort() {
- return mShort;
- }
-
- public void setShort(short pShort) {
- mShort = pShort;
- }
-
- private int mInt;
-
- public int getInt() {
- return mInt;
- }
-
- public void setInt(int pInt) {
- mInt = pInt;
- }
-
- private long mLong;
-
- public long getLong() {
- return mLong;
- }
-
- public void setLong(long pLong) {
- mLong = pLong;
- }
-
- private double mDouble;
-
- public double getDouble() {
- return mDouble;
- }
-
- public void setDouble(double pDouble) {
- mDouble = pDouble;
- }
-
- private float mFloat;
-
- public float getFloat() {
- return mFloat;
- }
-
- public void setFloat(float pFloat) {
- mFloat = pFloat;
- }
-
- private char mChar;
-
- public char getChar() {
- return mChar;
- }
-
- public void setChar(char pChar) {
- mChar = pChar;
- }
-
- //----------------------------------
- // Object types
- //----------------------------------
-
- private String mString;
-
- public String getString() {
- return mString;
- }
-
- public void setString(String pString) {
- mString = pString;
- }
-
- private Short mOShort;
-
- public Short getOShort() {
- return mOShort;
- }
-
- public void setOShort(Short pOShort) {
- mOShort = pOShort;
- }
-
- private Integer mOInteger;
-
- public Integer getOInteger() {
- return mOInteger;
- }
-
- public void setOInteger(Integer pOInteger) {
- mOInteger = pOInteger;
- }
-
- private Long mOLong;
-
- public Long getOLong() {
- return mOLong;
- }
-
- public void setOLong(Long pOLong) {
- mOLong = pOLong;
- }
-
- private Float mOFloat;
-
- public Float getOFloat() {
- return mOFloat;
- }
-
- public void setOFloat(Float pOFloat) {
- mOFloat = pOFloat;
- }
-
- private Double mODouble;
-
- public Double getODouble() {
- return mODouble;
- }
-
- public void setODouble(Double pODouble) {
- mODouble = pODouble;
- }
-
- @Property(name = "genericComponent")
- private GenericComponent mGenericComponent;
-
- public GenericComponent getGenericComponent() {
- return mGenericComponent;
- }
-
- public void setGenericComponent(GenericComponent pGenericComponent) {
- mGenericComponent = pGenericComponent;
- }
-
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/BadContextPojo.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/BadContextPojo.java
deleted file mode 100644
index 7840b57dea..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/BadContextPojo.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Context;
-
-public class BadContextPojo {
-
- @Context
- String moduleContext;
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/BadNamePojo.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/BadNamePojo.java
deleted file mode 100644
index d9753fa9f0..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/BadNamePojo.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.ComponentName;
-
-public class BadNamePojo {
- @ComponentName
- private int name;
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/DataObject.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/DataObject.java
deleted file mode 100644
index 695cc2a5a1..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/DataObject.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import java.io.Serializable;
-
-/**
- * A complex type for testing
- *
- * @version $Rev$ $Date$
- */
-public class DataObject implements Serializable {
-
- private String stringValue;
-
- public String getStringValue() {
- return stringValue;
- }
-
- public void setStringValue(String stringValue) {
- this.stringValue = stringValue;
- }
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/GenericComponent.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/GenericComponent.java
deleted file mode 100644
index 44f1c02bfd..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/GenericComponent.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import java.util.List;
-import java.util.Map;
-
-import org.osoa.sca.ModuleContext;
-
-/**
- * Generic test component
- *
- * @version $Rev$ $Date$
- */
-public interface GenericComponent {
-
- public String getName();
-
- public ModuleContext getModuleContext();
-
- // ----------------------------------
- // Collections
- // ----------------------------------
-
- public Map getTestMap();
-
- public void setTestMap(Map pTestMap);
-
- public List getTestList();
-
- public void setTestList(List pTestList);
-
- // ----------------------------------
- // Arrays
- // ----------------------------------
-
- public int[] getArrayInt();
-
- public void setArrayInt(int[] pArrayInt);
-
- public float[] getArrayFloat();
-
- public void setArrayFloat(float[] pArrayFloat);
-
- public double[] getArrayDouble();
-
- public void setArrayDouble(double[] pArrayDouble);
-
- public long[] getArrayLong();
-
- public void setArrayLong(long[] pArrayLong);
-
- public short[] getArrayShort();
-
- public void setArrayShort(short[] pArrayShort);
-
- public boolean[] getArrayBoolean();
-
- public void setArrayBoolean(boolean[] pArrayBoolean);
-
- public String[] getArrayString();
-
- public void setArrayString(String[] pArrayString);
-
- // ----------------------------------
- // Primitives
- // ----------------------------------
-
- public boolean getBoolean();
-
- public void setBoolean(boolean pBoolean);
-
- public short getShort();
-
- public void setShort(short pShort);
-
- public int getInt();
-
- public void setInt(int pInt);
-
- public long getLong();
-
- public void setLong(long pLong);
-
- public double getDouble();
-
- public void setDouble(double pDouble);
-
- public float getFloat();
-
- public void setFloat(float pFloat);
-
- public char getChar();
-
- public void setChar(char pChar);
-
- // ----------------------------------
- // Object types
- // ----------------------------------
-
- public String getString();
-
- public void setString(String pString);
-
- public Short getOShort();
-
- public void setOShort(Short pOShort);
-
- public Integer getOInteger();
-
- public void setOInteger(Integer pOInteger);
-
- public Long getOLong();
-
- public void setOLong(Long pOLong);
-
- public Float getOFloat();
-
- public void setOFloat(Float pOFloat);
-
- public Double getODouble();
-
- public void setODouble(Double pODouble);
-
- public GenericComponent getGenericComponent();
-
- public void setGenericComponent(GenericComponent pGenericComponent);
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/HelloWorldClient.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/HelloWorldClient.java
deleted file mode 100644
index 1e7ca9f36b..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/HelloWorldClient.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.apache.tuscany.container.java.assembly.mock.HelloWorldService;
-
-/**
- *
- *
- * @version $Rev$ $Date$
- */
-public class HelloWorldClient implements HelloWorldService{
-
- private int count;
-
- public HelloWorldClient() {
- }
-
- private HelloWorldService service;
-
- public void setHelloWorldService(HelloWorldService service){
- this.service = service;
- }
-
- public String hello(String name) {
- ++count;
- return service.hello(name);
- }
-
- public int count() {
- return count;
- }
-
-}
-
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/LocalComponentImpl.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/LocalComponentImpl.java
deleted file mode 100644
index 4b57c7f301..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/LocalComponentImpl.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.ModuleContext;
-import org.osoa.sca.annotations.ComponentName;
-import org.osoa.sca.annotations.Context;
-import org.osoa.sca.annotations.Property;
-import org.osoa.sca.annotations.Reference;
-
-/**
- * A test local service
- *
- * @version $Rev$ $Date$
- */
-
-public class LocalComponentImpl {
-
- @ComponentName
- protected String name;
-
- public String getName() {
- return name;
- }
-
- @Context
- protected ModuleContext moduleCtx;
-
- public ModuleContext getModuleContext() {
- return moduleCtx;
- }
-
- @Property(name = "fieldSetter", required = true)
- private String mfieldSetter;
-
- public String getfieldSetter() {
- return mfieldSetter;
- }
-
- public void setfieldSetter(String pfieldSetter) throws Exception {
- throw new Exception("Set method instead of field");
- }
-
- private String mMethodSetter;
- boolean mSetByMethod;
-
- public String getMethodSetter() throws Exception {
- if (mSetByMethod) {
- return mMethodSetter;
- }
- throw new Exception("Property method setter failed");
-
- }
-
- @Property(required = true)
- public void setMethodSetter(String pMethodSetter) {
- mSetByMethod = true;
- mMethodSetter = pMethodSetter;
- }
-
- @Reference(name = "requiredDataObject", required = true)
- private DataObject mRequiredDataObject;
-
- public DataObject getRequiredDataObject() {
- return mRequiredDataObject;
- }
-
- public void setRequiredDataObject(DataObject pRequiredDataObject) {
- mRequiredDataObject = pRequiredDataObject;
- }
-
- @Reference(name = "optionalDataObject")
- private DataObject mOptionalDataObject;
-
- public DataObject getOptionalDataObject() {
- return mOptionalDataObject;
- }
-
- public void setOptionalDataObject(DataObject pOptionalDataObject) {
- mOptionalDataObject = pOptionalDataObject;
- }
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponent.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponent.java
deleted file mode 100644
index 04cbb01de6..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponent.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Scope;
-
-/**
- * @version $Rev$ $Date$
- */
-@Scope("MODULE")
-public interface ModuleScopeComponent extends GenericComponent {
- public GenericComponent getGenericComponent();
-
- public String getString();
- //public boolean isInit();
-}
-
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponentImpl.componentType b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponentImpl.componentType
deleted file mode 100644
index ca4c633e59..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponentImpl.componentType
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-<!-- remove this once ImplementationImpl is fixed not to requrie this -->
-<componentType xmlns="http://www.osoa.org/xmlns/sca/0.9">
-
- <service name="ModuleScopeComponent" scope="module">
- <interface.java interface="janus.test.component.ModuleScopeComponent"/>
- </service>
- <!-- Not supported, not in the spec
- <property.java name="mInt" class="java.lang.Integer" default="default"/>
- <property.java name="foo" class="java.lang.String" default="default"/>
- -->
- <reference name="mGenericComponent" multiplicity="0..1">
- <interface.java interface="test.org.apache.tuscany.container.java.components.AbstractGenericComponent"/>
- </reference>
-
-</componentType>
-
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponentImpl.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponentImpl.java
deleted file mode 100644
index 7981208b9e..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeComponentImpl.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Scope;
-
-
-/**
- * @version $Rev$ $Date$
- */
-@Scope("MODULE")
-public class ModuleScopeComponentImpl extends AbstractGenericComponent implements
- ModuleScopeComponent {
-
- private String foo;
-
- public void setFoo(String foo) {
- this.foo = foo;
- }
-
- public String getFoo() {
- return foo;
- }
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeDestroyOnlyComponent.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeDestroyOnlyComponent.java
deleted file mode 100644
index 76218c2d6c..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeDestroyOnlyComponent.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Destroy;
-
-public class ModuleScopeDestroyOnlyComponent extends ModuleScopeComponentImpl {
-
- boolean destroyed = false;
-
- public boolean isDestroyed() {
- return destroyed;
- }
-
- @Destroy
- public void destroy() {
- destroyed = true;
- }
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeEagerInitComponent.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeEagerInitComponent.java
deleted file mode 100644
index 56a0421f24..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeEagerInitComponent.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Init;
-
-public class ModuleScopeEagerInitComponent extends ModuleScopeComponentImpl {
-
- boolean initialized = false;
-
- public boolean isInitialized() {
- return initialized;
- }
-
- // this value tests to ensure introspection can find the init() method even
- // if a field is named the same. Ultimately, this should be in the
- // introspection tests
- private boolean init;
-
- @Init(eager = true)
- public void init() {
- initialized = true;
- }
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeEagerInitDestroyComponent.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeEagerInitDestroyComponent.java
deleted file mode 100644
index dae156737a..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeEagerInitDestroyComponent.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Destroy;
-
-public class ModuleScopeEagerInitDestroyComponent extends ModuleScopeEagerInitComponent {
-
- boolean destroyed = false;
-
- public boolean isDestroyed() {
- return destroyed;
- }
-
- @Destroy
- public void destroy() {
- destroyed = true;
- }
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeInitDestroyComponent.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeInitDestroyComponent.java
deleted file mode 100644
index 695157612b..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeInitDestroyComponent.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Destroy;
-
-public class ModuleScopeInitDestroyComponent extends ModuleScopeInitOnlyComponent {
-
- boolean destroyed = false;
-
- public boolean isDestroyed() {
- return destroyed;
- }
-
- @Destroy
- public void destroy() {
- if (destroyed){
- throw new AssertionError("Destroy called more than once");
- }
- destroyed = true;
- }
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeInitOnlyComponent.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeInitOnlyComponent.java
deleted file mode 100644
index 4945309852..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/ModuleScopeInitOnlyComponent.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Init;
-
-public class ModuleScopeInitOnlyComponent extends ModuleScopeComponentImpl {
-
- boolean initialized = false;
-
- public boolean isInitialized() {
- return initialized;
- }
-
- // this value tests to ensure introspection can find the init() method even
- // if a field is named the same. Ultimately, this should be in the introspection tests
- private boolean init;
-
- @Init
- public void init() {
- if (initialized){
- throw new AssertionError("Init called more than once");
- }
- initialized = true;
- }
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/OtherTarget.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/OtherTarget.java
deleted file mode 100644
index 2edc8246db..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/OtherTarget.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-/**
- * Implementations are used in wiring tests
- *
- * @version $Rev$ $Date$
- */
-public interface OtherTarget {
-
- public String getString();
-
- public void setString(String val);
-}
-
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/OtherTargetImpl.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/OtherTargetImpl.java
deleted file mode 100644
index 08d4d9f720..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/OtherTargetImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-/**
- * A target used for testing wires with a different source and target interface
- *
- * @version $Rev$ $Date$
- */
-public class OtherTargetImpl implements OtherTarget{
-
- private String theString;
-
- public String getString() {
- return theString;
- }
-
- public void setString(String val) {
- theString = val;
- }
-
-
-}
-
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RemotableService.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RemotableService.java
deleted file mode 100644
index 645fd7f47c..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RemotableService.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Remotable;
-
-/**
- * Used for testing basic remoting operations
- *
- * @version $Rev$ $Date$
- */
-
-@Remotable
-public interface RemotableService {
-
- public void syncOneWay(String msg);
-
- public String syncTwoWay(String msg);
-
- public DataObject syncTwoWayCustomType(DataObject val);
-
- public String getString();
-
- public void setString(String string);
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RemotableServiceImpl.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RemotableServiceImpl.java
deleted file mode 100644
index 34a4273323..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RemotableServiceImpl.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import junit.framework.Assert;
-import org.osoa.sca.annotations.Property;
-
-
-/**
- * @version $Rev$ $Date$
- */
-public class RemotableServiceImpl implements RemotableService {
-
- // ----------------------------------
- // Properties
- // ----------------------------------
-
- @Property(name = "string", required = true)
- private String mString;
-
- public String getString() {
- return mString;
- }
-
- public void setString(String string) {
- mString = string;
- }
-
- // ----------------------------------
- // Methods
- // ----------------------------------
-
- public void syncOneWay(String msg) {
- Assert.assertEquals("hello", msg);
- }
-
- public String syncTwoWay(String msg) {
- return "response";
- }
-
- public DataObject syncTwoWayCustomType(DataObject val) {
- Assert.assertEquals("hello", val.getStringValue());
- DataObject dto = new DataObject();
- dto.setStringValue("return");
- return dto;
- }
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeComponent.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeComponent.java
deleted file mode 100644
index ac7931bd2c..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeComponent.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Scope;
-
-/**
- * @version $Rev$ $Date$
- */
-@Scope("REQUEST")
-public interface RequestScopeComponent extends GenericComponent {
-
-}
-
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeComponentImpl.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeComponentImpl.java
deleted file mode 100644
index 5b20519d90..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeComponentImpl.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-/**
- * @version $Rev$ $Date$
- */
-public class RequestScopeComponentImpl extends AbstractGenericComponent implements
- RequestScopeComponent {
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeDestroyOnlyComponent.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeDestroyOnlyComponent.java
deleted file mode 100644
index ae63f761c3..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeDestroyOnlyComponent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Destroy;
-import org.osoa.sca.annotations.Scope;
-
-@Scope("REQUEST")
-public class RequestScopeDestroyOnlyComponent extends SessionScopeComponentImpl {
-
- boolean destroyed = false;
-
- public boolean isDestroyed() {
- return destroyed;
- }
-
- @Destroy
- public void destroy() {
- destroyed = true;
- }
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeInitDestroyComponent.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeInitDestroyComponent.java
deleted file mode 100644
index 67f61df36d..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeInitDestroyComponent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Destroy;
-import org.osoa.sca.annotations.Scope;
-
-@Scope("REQUEST")
-public class RequestScopeInitDestroyComponent extends SessionScopeInitOnlyComponent {
-
- boolean destroyed = false;
-
- public boolean isDestroyed() {
- return destroyed;
- }
-
- @Destroy
- public void destroy() {
- destroyed = true;
- }
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeInitOnlyComponent.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeInitOnlyComponent.java
deleted file mode 100644
index c6c621f518..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/RequestScopeInitOnlyComponent.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Scope;
-
-@Scope("REQUEST")
-public class RequestScopeInitOnlyComponent extends SessionScopeComponentImpl {
-
- boolean initialized = false;
-
- public boolean isInitialized() {
- return initialized;
- }
-
- @Init
- public void init() {
- initialized = true;
- }
-
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeComponent.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeComponent.java
deleted file mode 100644
index 236e083a2b..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeComponent.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Scope;
-
-/**
- * @version $Rev$ $Date$
- */
-@Scope("SESSION")
-public interface SessionScopeComponent extends GenericComponent {
-
-}
-
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeComponentImpl.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeComponentImpl.java
deleted file mode 100644
index 265969a450..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeComponentImpl.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Scope;
-
-/**
- * @version $Rev$ $Date$
- */
-@Scope("SESSION")
-public class SessionScopeComponentImpl extends AbstractGenericComponent implements
- SessionScopeComponent {
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeDestroyOnlyComponent.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeDestroyOnlyComponent.java
deleted file mode 100644
index be20a23d29..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeDestroyOnlyComponent.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Destroy;
-
-public class SessionScopeDestroyOnlyComponent extends SessionScopeComponentImpl {
-
- boolean destroyed = false;
-
- public boolean isDestroyed() {
- return destroyed;
- }
-
- @Destroy
- public void destroy() {
- destroyed = true;
- }
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeInitDestroyComponent.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeInitDestroyComponent.java
deleted file mode 100644
index 32aa0142a4..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeInitDestroyComponent.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Destroy;
-
-public class SessionScopeInitDestroyComponent extends SessionScopeInitOnlyComponent {
-
- boolean destroyed = false;
-
- public boolean isDestroyed() {
- return destroyed;
- }
-
- @Destroy
- public void destroy() {
- destroyed = true;
- }
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeInitOnlyComponent.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeInitOnlyComponent.java
deleted file mode 100644
index a518a9b244..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SessionScopeInitOnlyComponent.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Init;
-
-public class SessionScopeInitOnlyComponent extends SessionScopeComponentImpl {
-
- boolean initialized = false;
-
- public boolean isInitialized() {
- return initialized;
- }
-
- @Init
- public void init() {
- initialized = true;
- }
-
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/Source.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/Source.java
deleted file mode 100644
index 1f918590f2..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/Source.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import java.util.List;
-
-/**
- * Implementations are used in wiring tests
- *
- * @version $Rev$ $Date$
- */
-public interface Source {
-
- public Target getTarget();
-
- public List<Target> getTargets();
-
- public List<Target> getTargetsThroughField();
-
-}
-
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SourceImpl.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SourceImpl.java
deleted file mode 100644
index a2588bae5e..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/SourceImpl.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import java.util.List;
-
-/**
- * Mock system component implementation used in wiring tests
- *
- * @version $Rev$ $Date$
- */
-public class SourceImpl implements Source {
-
- private Target target;
-
- private List<Target> targets;
-
- private List<Target> targetsThroughField;
-
- public void setTarget(Target target) {
- this.target = target;
- }
-
- public Target getTarget() {
- return target;
- }
-
- public List<Target> getTargets() {
- return targets;
- }
-
- public void setTargets(List<Target> targets) {
- this.targets = targets;
- }
-
- public List<Target> getTargetsThroughField() {
- return targetsThroughField;
- }
-
-
- private Target[] targetsArray;
-
- public Target[] getArrayOfTargets() {
- return targetsArray;
- }
-
- public void setArrayOfTargets(Target[] targets) {
- targetsArray = targets;
- }
-
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/StatelessComponent.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/StatelessComponent.java
deleted file mode 100644
index 3fe84dd785..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/StatelessComponent.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-import org.osoa.sca.annotations.Scope;
-
-/**
- * @version $Rev$ $Date$
- */
-@Scope("STATELESS")
-public interface StatelessComponent extends GenericComponent {
-
-}
-
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/StatelessComponentImpl.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/StatelessComponentImpl.java
deleted file mode 100644
index 8b806d6a2e..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/StatelessComponentImpl.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-/**
- * @version $Rev$ $Date$
- */
-public class StatelessComponentImpl extends AbstractGenericComponent implements
- StatelessComponent {
-
-}
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/Target.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/Target.java
deleted file mode 100644
index a56e52c898..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/Target.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-/**
- * Implementations are used in wiring tests
- *
- * @version $Rev$ $Date$
- */
-public interface Target {
-
- public String getString();
-
- public void setString(String val);
-}
-
diff --git a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/TargetImpl.java b/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/TargetImpl.java
deleted file mode 100644
index 5a10bfdbc1..0000000000
--- a/tags/java-M1-20060518/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/components/TargetImpl.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- *
- * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-package org.apache.tuscany.container.java.mock.components;
-
-/**
- * Mock system component implementation used in wiring tests
- *
- * @version $Rev$ $Date$
- */
-public class TargetImpl implements Target {
-
- private String theString;
-
- public String getString() {
- return theString;
- }
-
- public void setString(String val) {
- theString = val;
- }
-
-}