diff options
Diffstat (limited to 'branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/InstanceWrapperImpl.java')
-rw-r--r-- | branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/InstanceWrapperImpl.java | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/InstanceWrapperImpl.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/InstanceWrapperImpl.java deleted file mode 100644 index c4648d1e7b..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/InstanceWrapperImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.component.scope; - -import org.apache.tuscany.spi.component.AtomicComponent; -import org.apache.tuscany.spi.component.TargetDestructionException; -import org.apache.tuscany.spi.component.TargetInitializationException; - -/** - * Default implementation of an <code>InstanceWrapper</code> - * - * @version $$Rev$$ $$Date$$ - */ -public class InstanceWrapperImpl implements InstanceWrapper { - private Object instance; - private AtomicComponent component; - private boolean started; - - public InstanceWrapperImpl(AtomicComponent component, Object instance) { - assert component != null; - assert instance != null; - this.component = component; - this.instance = instance; - } - - public boolean isStarted() { - return started; - } - - public Object getInstance() { - if (!started) { - throw new IllegalStateException("Instance not started"); - } - return instance; - } - - public void start() throws TargetInitializationException { - component.init(instance); - started = true; - } - - public void stop() throws TargetDestructionException { - component.destroy(instance); - started = false; - } - -} |