diff options
Diffstat (limited to 'branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/SingletonListObjectFactory.java')
-rw-r--r-- | branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/SingletonListObjectFactory.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/SingletonListObjectFactory.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/SingletonListObjectFactory.java new file mode 100644 index 0000000000..fe503bfd68 --- /dev/null +++ b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/SingletonListObjectFactory.java @@ -0,0 +1,42 @@ +/*
+ * 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.injection;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.tuscany.spi.ObjectFactory;
+
+/**
+ * Implementation of ObjectFactory that returns a single instance, typically an immutable type.
+ *
+ * @version $Rev: 430937 $ $Date: 2006-08-12 06:47:56 +0530 (Sat, 12 Aug 2006) $
+ */
+public class SingletonListObjectFactory<T> implements ObjectFactory<List<T>> {
+ private List<T> instance;
+
+ public SingletonListObjectFactory(List<T> instance) {
+ this.instance = Collections.unmodifiableList(instance);
+ }
+
+ public List<T> getInstance() {
+ return instance;
+ }
+
+}
|