summaryrefslogtreecommitdiffstats
path: root/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config
diff options
context:
space:
mode:
Diffstat (limited to 'tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config')
-rw-r--r--tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemComponentRuntimeConfiguration.java140
-rw-r--r--tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemEntryPointRuntimeConfiguration.java92
-rw-r--r--tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemExternalServiceRuntimeConfiguration.java97
-rw-r--r--tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemObjectRuntimeConfiguration.java92
4 files changed, 0 insertions, 421 deletions
diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemComponentRuntimeConfiguration.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemComponentRuntimeConfiguration.java
deleted file mode 100644
index cf05059b90..0000000000
--- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemComponentRuntimeConfiguration.java
+++ /dev/null
@@ -1,140 +0,0 @@
-package org.apache.tuscany.core.system.config;
-
-import java.lang.reflect.Constructor;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.core.builder.ContextCreationException;
-import org.apache.tuscany.core.builder.RuntimeConfiguration;
-import org.apache.tuscany.core.context.AggregateContext;
-import org.apache.tuscany.core.context.InstanceContext;
-import org.apache.tuscany.core.injection.EventInvoker;
-import org.apache.tuscany.core.injection.Injector;
-import org.apache.tuscany.core.injection.PojoObjectFactory;
-import org.apache.tuscany.core.invocation.spi.ProxyFactory;
-import org.apache.tuscany.core.system.context.SystemComponentContext;
-import org.apache.tuscany.model.assembly.Scope;
-
-/**
- * A RuntimeConfiguration that handles system component implementation types
- *
- * @version $Rev$ $Date$
- */
-public class SystemComponentRuntimeConfiguration implements RuntimeConfiguration<InstanceContext> {
-
- // the component name as configured in the hosting module
- private String name;
-
- // the implementation type constructor
- private Constructor ctr;
-
- // injectors for properties, references and other metadata values such as @Context
- private List<Injector> setters;
-
- // an invoker for a method decorated with @Init
- private EventInvoker init;
-
- // whether the component should be eagerly initialized when its scope starts
- private boolean eagerInit;
-
- // an invoker for a method decorated with @Destroy
- private EventInvoker destroy;
-
- // the scope of the implementation instance
- private Scope scope;
-
- // if the component implementation scope is stateless
- private boolean stateless;
-
- // if the component implementation is an aggregate context
- private boolean isAggregate;
-
- // ----------------------------------
- // Constructors
- // ----------------------------------
-
- /**
- * Creates the runtime configuration
- *
- * @param name the SCDL name of the component the context refers to
- * @param ctr the implementation type constructor
- * @param setters a collection of <code>Injectors</code> used to configure properties, references and other meta
- * data values on implementation instances
- * @param eagerInit whether the component should be eagerly initialized
- * @param init an <code>Invoker</code> pointing to a method on the implementation type decorated with
- * <code>@Init</code>
- * @param destroy an <code>Invoker</code> pointing to a method on the implementation type decorated with
- * <code>@Destroy</code>
- * @param scope the scope of the component implementation type
- */
- public SystemComponentRuntimeConfiguration(String name, Constructor ctr, List<Injector> setters, boolean eagerInit,
- EventInvoker init, EventInvoker destroy, Scope scope) {
- assert (name != null) : "Name was null";
- assert (ctr != null) : "Constructor was null";
- assert (setters != null) : "Setters were null";
- this.name = name;
- this.ctr = ctr;
- this.isAggregate = AggregateContext.class.isAssignableFrom(ctr.getDeclaringClass());
- this.setters = setters;
- this.eagerInit = eagerInit;
- this.init = init;
- this.destroy = destroy;
- this.scope = scope;
- stateless = (scope == Scope.INSTANCE);
- }
-
- // ----------------------------------
- // Methods
- // ----------------------------------
-
- public String getName() {
- return name;
- }
-
- public Scope getScope() {
- return scope;
- }
-
- public InstanceContext createInstanceContext() throws ContextCreationException {
- if (isAggregate) {
- // aggregate context types are themselves an instance context
- PojoObjectFactory objectFactory = new PojoObjectFactory(ctr, null, setters);
- AggregateContext ctx = (AggregateContext) objectFactory.getInstance();
- ctx.setName(name);
- return ctx;
- } else {
- PojoObjectFactory objectFactory = new PojoObjectFactory(ctr, null, setters);
- return new SystemComponentContext(name, objectFactory, eagerInit, init, destroy, stateless);
- }
- }
-
- // -- Proxy
-
- public void prepare() {
- }
-
- public void addTargetProxyFactory(String serviceName, ProxyFactory factory) {
- throw new UnsupportedOperationException();
- }
-
- public ProxyFactory getTargetProxyFactory(String serviceName) {
- return null;
- }
-
- public Map<String, ProxyFactory> getTargetProxyFactories() {
- return null;
- }
-
- public void addSourceProxyFactory(String referenceName, ProxyFactory factory) {
- throw new UnsupportedOperationException();
- }
-
- public ProxyFactory getSourceProxyFactory(String referenceName) {
- return null;
- }
-
- public Map<String, ProxyFactory> getSourceProxyFactories() {
- return null;
- }
-
-}
diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemEntryPointRuntimeConfiguration.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemEntryPointRuntimeConfiguration.java
deleted file mode 100644
index f6c25e9b86..0000000000
--- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemEntryPointRuntimeConfiguration.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.core.system.config;
-
-import java.util.Map;
-
-import org.apache.tuscany.core.builder.ContextCreationException;
-import org.apache.tuscany.core.builder.ObjectFactory;
-import org.apache.tuscany.core.builder.RuntimeConfiguration;
-import org.apache.tuscany.core.context.EntryPointContext;
-import org.apache.tuscany.core.invocation.spi.ProxyFactory;
-import org.apache.tuscany.core.system.context.SystemEntryPointContext;
-import org.apache.tuscany.model.assembly.Scope;
-
-/**
- * Creates {@link SystemEntryPointContext} instances based on an entry point configuration in an assembly model
- *
- * @version $Rev$ $Date$
- */
-public class SystemEntryPointRuntimeConfiguration implements RuntimeConfiguration<EntryPointContext> {
-
- // the name of the entry point
- private String name;
-
- // the factory for returning a reference to the implementation instance of the component exposed by the entry point
- private ObjectFactory factory;
-
- // ----------------------------------
- // Constructors
- // ----------------------------------
-
- public SystemEntryPointRuntimeConfiguration(String name, ObjectFactory factory) {
- this.name = name;
- this.factory = factory;
- }
-
- // ----------------------------------
- // Methods
- // ----------------------------------
-
- public EntryPointContext createInstanceContext() throws ContextCreationException {
- return new SystemEntryPointContext(name, factory);
- }
-
- public Scope getScope() {
- return Scope.MODULE;
- }
-
- public String getName() {
- return name;
- }
-
- // -- Proxy
- public void prepare() {
- }
-
- public void addTargetProxyFactory(String serviceName, ProxyFactory pFactory) {
- throw new UnsupportedOperationException();
- }
-
- public ProxyFactory getTargetProxyFactory(String serviceName) {
- return null;
- }
-
- public Map<String, ProxyFactory> getTargetProxyFactories() {
- return null;
- }
-
- public void addSourceProxyFactory(String referenceName, ProxyFactory pFactory) {
- throw new UnsupportedOperationException();
- }
-
- public ProxyFactory getSourceProxyFactory(String referenceName) {
- return null;
- }
-
- public Map<String, ProxyFactory> getSourceProxyFactories() {
- return null;
- }
-
-}
diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemExternalServiceRuntimeConfiguration.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemExternalServiceRuntimeConfiguration.java
deleted file mode 100644
index 789982bdcf..0000000000
--- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemExternalServiceRuntimeConfiguration.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.core.system.config;
-
-import java.util.Map;
-
-import org.apache.tuscany.core.builder.ContextCreationException;
-import org.apache.tuscany.core.builder.ObjectFactory;
-import org.apache.tuscany.core.builder.RuntimeConfiguration;
-import org.apache.tuscany.core.context.ExternalServiceContext;
-import org.apache.tuscany.core.invocation.spi.ProxyFactory;
-import org.apache.tuscany.core.system.context.SystemExternalServiceContext;
-import org.apache.tuscany.model.assembly.Scope;
-
-/**
- * Creates system type external service contexts
- *
- * @see org.apache.tuscany.core.context.ExternalServiceContext
- * @see org.apache.tuscany.core.system.context.SystemExternalServiceContext
- *
- * @version $Rev$ $Date$
- */
-public class SystemExternalServiceRuntimeConfiguration implements RuntimeConfiguration<ExternalServiceContext> {
-
- // the name of the external service
- private String name;
-
- // the factory for returning a reference to the implementation instance of the component represented by the external service
- private ObjectFactory factory;
-
- // ----------------------------------
- // Constructors
- // ----------------------------------
-
- public SystemExternalServiceRuntimeConfiguration(String name, ObjectFactory factory) {
- assert (name != null) : "Name was null";
- assert (factory != null) : "Object factory was null";
- this.name = name;
- this.factory = factory;
- }
-
- // ----------------------------------
- // Methods
- // ----------------------------------
-
- public Scope getScope() {
- return Scope.MODULE;
- }
-
- public String getName() {
- return name;
- }
-
- public ExternalServiceContext createInstanceContext() throws ContextCreationException {
- return new SystemExternalServiceContext(name, factory);
- }
-
- // -- Proxy
- public void prepare() {
- }
-
- public void addTargetProxyFactory(String serviceName, ProxyFactory pFactory) {
- throw new UnsupportedOperationException();
- }
-
- public ProxyFactory getTargetProxyFactory(String serviceName) {
- return null;
- }
-
- public Map<String, ProxyFactory> getTargetProxyFactories() {
- return null;
- }
-
- public void addSourceProxyFactory(String referenceName, ProxyFactory pFactory) {
- throw new UnsupportedOperationException();
- }
-
- public ProxyFactory getSourceProxyFactory(String referenceName) {
- return null;
- }
-
- public Map<String, ProxyFactory> getSourceProxyFactories() {
- return null;
- }
-
-}
diff --git a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemObjectRuntimeConfiguration.java b/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemObjectRuntimeConfiguration.java
deleted file mode 100644
index 06acb12deb..0000000000
--- a/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/system/config/SystemObjectRuntimeConfiguration.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- *
- * Copyright 2005 BEA Systems Inc.
- * Copyright 2005 International Business Machines Corporation
- *
- * 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.core.system.config;
-
-import java.util.Map;
-
-import org.apache.tuscany.core.builder.ContextCreationException;
-import org.apache.tuscany.core.builder.ObjectFactory;
-import org.apache.tuscany.core.builder.RuntimeConfiguration;
-import org.apache.tuscany.core.context.Context;
-import org.apache.tuscany.core.injection.SingletonObjectFactory;
-import org.apache.tuscany.core.invocation.spi.ProxyFactory;
-import org.apache.tuscany.core.system.context.SystemComponentContext;
-import org.apache.tuscany.model.assembly.Scope;
-
-/**
- * A RuntimeConfiguration that contains the configuration needed to convert a simple
- * Java Object into a component. The object is assumed to be fully initialized and
- * will always be added with MODULE scope.
- *
- * @version $Rev$ $Date$
- */
-public class SystemObjectRuntimeConfiguration implements RuntimeConfiguration {
- private final String name;
- private final ObjectFactory<?> objectFactory;
-
- /**
- * Construct a RuntimeConfiguration for the supplied Java Object.
- *
- * @param name the name to be assigned to the resulting component
- * @param instance the Java Object that provides the implementation
- */
- public SystemObjectRuntimeConfiguration(String name, Object instance) {
- this.name = name;
- objectFactory = new SingletonObjectFactory(instance);
- }
-
- public Context createInstanceContext() throws ContextCreationException {
- return new SystemComponentContext(name, objectFactory, false, null, null, false);
- }
-
- public Scope getScope() {
- return Scope.MODULE;
- }
-
- public String getName() {
- return name;
- }
-
- public void prepare() {
- throw new UnsupportedOperationException();
- }
-
- public void addTargetProxyFactory(String serviceName, ProxyFactory factory) {
- throw new UnsupportedOperationException();
- }
-
- public ProxyFactory getTargetProxyFactory(String serviceName) {
- throw new UnsupportedOperationException();
- }
-
- public Map getTargetProxyFactories() {
- throw new UnsupportedOperationException();
- }
-
- public void addSourceProxyFactory(String referenceName, ProxyFactory factory) {
- throw new UnsupportedOperationException();
- }
-
- public ProxyFactory getSourceProxyFactory(String referenceName) {
- throw new UnsupportedOperationException();
- }
-
- public Map getSourceProxyFactories() {
- throw new UnsupportedOperationException();
- }
-}