You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2007/03/24 03:22:26 UTC
svn commit: r521963 - in
/incubator/tuscany/sandbox/rfeng/minicore/src/main/java/org/apache/tuscany/core/injection:
./ SingletonObjectFactory.java
Author: rfeng
Date: Fri Mar 23 19:22:25 2007
New Revision: 521963
URL: http://svn.apache.org/viewvc?view=rev&rev=521963
Log:
Add missing class
Added:
incubator/tuscany/sandbox/rfeng/minicore/src/main/java/org/apache/tuscany/core/injection/
incubator/tuscany/sandbox/rfeng/minicore/src/main/java/org/apache/tuscany/core/injection/SingletonObjectFactory.java (with props)
Added: incubator/tuscany/sandbox/rfeng/minicore/src/main/java/org/apache/tuscany/core/injection/SingletonObjectFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/rfeng/minicore/src/main/java/org/apache/tuscany/core/injection/SingletonObjectFactory.java?view=auto&rev=521963
==============================================================================
--- incubator/tuscany/sandbox/rfeng/minicore/src/main/java/org/apache/tuscany/core/injection/SingletonObjectFactory.java (added)
+++ incubator/tuscany/sandbox/rfeng/minicore/src/main/java/org/apache/tuscany/core/injection/SingletonObjectFactory.java Fri Mar 23 19:22:25 2007
@@ -0,0 +1,39 @@
+/*
+ * 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 org.apache.tuscany.spi.ObjectFactory;
+
+/**
+ * Implementation of ObjectFactory that returns a single instance, typically an immutable type.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SingletonObjectFactory<T> implements ObjectFactory<T> {
+ private final T instance;
+
+ public SingletonObjectFactory(T instance) {
+ this.instance = instance;
+ }
+
+ public T getInstance() {
+ return instance;
+ }
+
+}
Propchange: incubator/tuscany/sandbox/rfeng/minicore/src/main/java/org/apache/tuscany/core/injection/SingletonObjectFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/rfeng/minicore/src/main/java/org/apache/tuscany/core/injection/SingletonObjectFactory.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org