You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jb...@apache.org on 2007/03/12 20:12:51 UTC
svn commit: r517340 - in /incubator/tuscany/java/sca/kernel:
core/src/main/java/org/apache/tuscany/core/component/scope/
spi/src/main/java/org/apache/tuscany/spi/component/
Author: jboynes
Date: Mon Mar 12 12:12:51 2007
New Revision: 517340
URL: http://svn.apache.org/viewvc?view=rev&rev=517340
Log:
add start/stop context methods to ScopeContainer
Modified:
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/AbstractScopeContainer.java
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/StatelessScopeContainer.java
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ScopeContainer.java
Modified: incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/AbstractScopeContainer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/AbstractScopeContainer.java?view=diff&rev=517340&r1=517339&r2=517340
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/AbstractScopeContainer.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/AbstractScopeContainer.java Mon Mar 12 12:12:51 2007
@@ -44,7 +44,7 @@
*
* @version $Rev$ $Date$
*/
-public abstract class AbstractScopeContainer extends AbstractLifecycle implements ScopeContainer {
+public abstract class AbstractScopeContainer<KEY> extends AbstractLifecycle implements ScopeContainer<KEY> {
private static final EventFilter TRUE_FILTER = new TrueFilter();
protected WorkContext workContext;
@@ -61,6 +61,12 @@
}
public void unregister(AtomicComponent component) {
+ }
+
+ public void startContext(KEY contextId) {
+ }
+
+ public void stopContext(KEY contextId) {
}
public void addListener(RuntimeEventListener listener) {
Modified: incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/StatelessScopeContainer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/StatelessScopeContainer.java?view=diff&rev=517340&r1=517339&r2=517340
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/StatelessScopeContainer.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/StatelessScopeContainer.java Mon Mar 12 12:12:51 2007
@@ -28,11 +28,11 @@
import org.apache.tuscany.spi.model.Scope;
/**
- * A scope context which manages stateless atomic component instances in a non-pooled fashion
+ * A scope context which manages stateless atomic component instances in a non-pooled fashion.
*
* @version $Rev$ $Date$
*/
-public class StatelessScopeContainer extends AbstractScopeContainer {
+public class StatelessScopeContainer<KEY> extends AbstractScopeContainer<KEY> {
public StatelessScopeContainer(WorkContext workContext, ScopeContainerMonitor monitor) {
super(workContext, monitor);
Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ScopeContainer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ScopeContainer.java?view=diff&rev=517340&r1=517339&r2=517340
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ScopeContainer.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ScopeContainer.java Mon Mar 12 12:12:51 2007
@@ -27,22 +27,43 @@
* Manages the lifecycle and visibility of instances associated with a an {@link AtomicComponent}.
*
* @version $Rev$ $Date$
+ * @param <KEY> the type of IDs that this container uses to identify its contexts.
+ * For example, for COMPOSITE scope this could be the URI of the composite component,
+ * or for HTTP Session scope it might be the HTTP session ID.
*/
-public interface ScopeContainer extends Lifecycle, RuntimeEventListener {
+public interface ScopeContainer<KEY> extends Lifecycle, RuntimeEventListener {
/**
- * Returns the scope value representing the scope context
+ * Returns the Scope that this container supports.
+ *
+ * @return the Scope that this container supports
*/
Scope getScope();
/**
+ * Start a new context with the supplied ID.
+ *
+ * @param contextId an ID that uniquely identifies the context.
+ */
+ void startContext(KEY contextId);
+
+ /**
+ * Stop the context with the supplied ID.
+ *
+ * @param contextId an ID that uniquely identifies the context.
+ */
+ void stopContext(KEY contextId);
+
+ /**
* Registers a component with the scope.
+ *
* @param component the component to register
*/
void register(AtomicComponent component);
/**
* Unregisters a component with the scope.
+ *
* @param component the component to unregister
*/
void unregister(AtomicComponent component);
@@ -65,7 +86,7 @@
/**
* Return a wrapper after use (for example, after invoking the instance).
- *
+ *
* @param component the component
*/
<T> void returnWrapper(AtomicComponent component, InstanceWrapper<T> wrapper) throws TargetDestructionException;
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org