You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by ge...@apache.org on 2009/01/17 22:20:44 UTC
svn commit: r735334 - in
/incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans:
Obtains.java manager/Bean.java manager/Context.java manager/Contextual.java
manager/CreationalContext.java manager/Instance.java manager/Manager.java
Author: gerdogdu
Date: Sat Jan 17 13:20:43 2009
New Revision: 735334
URL: http://svn.apache.org/viewvc?rev=735334&view=rev
Log:
Adding new interfaces or updating olds for adapting latest spec.
Added:
incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/Obtains.java (with props)
incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Instance.java (with props)
Modified:
incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Bean.java
incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Context.java
incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Contextual.java
incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/CreationalContext.java
incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java
Added: incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/Obtains.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/Obtains.java?rev=735334&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/Obtains.java (added)
+++ incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/Obtains.java Sat Jan 17 13:20:43 2009
@@ -0,0 +1,29 @@
+/*
+ * 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 javax.webbeans;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.FIELD,ElementType.PARAMETER})
+public @interface Obtains
+{
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/Obtains.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Bean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Bean.java?rev=735334&r1=735333&r2=735334&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Bean.java (original)
+++ incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Bean.java Sat Jan 17 13:20:43 2009
@@ -87,7 +87,7 @@
* @param container web beans container
* @return the new web beans component instance
*/
- public abstract T create();
+ public abstract T create(CreationalContext<T> context);
/**
* Destoy the precreated web beans component instance.
Modified: incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Context.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Context.java?rev=735334&r1=735333&r2=735334&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Context.java (original)
+++ incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Context.java Sat Jan 17 13:20:43 2009
@@ -15,47 +15,13 @@
import java.lang.annotation.Annotation;
-/**
- * @author gurkanerdogdu
- * @since 1.0
- */
public interface Context
{
- /**
- * Gets the context scope type.
- *
- * @return context scope type
- */
public Class<? extends Annotation> getScopeType();
- /**
- * Gets the given web beans component instance from the context.
- * <p>
- * If the create argument is true and the instance is not contained in the
- * context, new instance is created and returned.
- * </p>
- *
- * @param <T> generic type
- * @param container web beans container
- * @param component web beans component
- * @param create creat or not flag
- * @return the web beans component instance
- */
- public <T> T get(Bean<T> component, boolean create);
+ public <T> T get(Contextual<T> component, boolean create,CreationalContext<T> crreationalContext);
+
+ public <T> T get(Contextual<T> component, boolean create);
- /**
- * Removes the given web beans component from the context.
- *
- * @param <T> generic type
- * @param component web beans component
- */
- @Deprecated
- public <T> void remove(Manager container, Bean<T> component);
-
- /**
- * True if context is active
- *
- * @return true if context is active
- */
boolean isActive();
}
Modified: incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Contextual.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Contextual.java?rev=735334&r1=735333&r2=735334&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Contextual.java (original)
+++ incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Contextual.java Sat Jan 17 13:20:43 2009
@@ -18,7 +18,7 @@
public interface Contextual<T>
{
- public T create();
+ public T create(CreationalContext<T> context);
public void destroy(T instance);
}
Modified: incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/CreationalContext.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/CreationalContext.java?rev=735334&r1=735333&r2=735334&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/CreationalContext.java (original)
+++ incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/CreationalContext.java Sat Jan 17 13:20:43 2009
@@ -18,6 +18,8 @@
public interface CreationalContext<T>
{
- public void push(T incompleteInstance);
+ public void push(Bean<T> bean, T incompleteInstance);
+
+ public T pop(Bean<T> bean);
}
Added: incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Instance.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Instance.java?rev=735334&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Instance.java (added)
+++ incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Instance.java Sat Jan 17 13:20:43 2009
@@ -0,0 +1,25 @@
+/*
+ * 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 javax.webbeans.manager;
+
+import java.lang.annotation.Annotation;
+
+public interface Instance<T>
+{
+ T get(Annotation...annotations);
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Instance.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java?rev=735334&r1=735333&r2=735334&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java (original)
+++ incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java Sat Jan 17 13:20:43 2009
@@ -13,11 +13,11 @@
*/
package javax.webbeans.manager;
-import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.util.List;
import java.util.Set;
+import javax.webbeans.InjectionPoint;
import javax.webbeans.NonBinding;
import javax.webbeans.Observer;
import javax.webbeans.TypeLiteral;
@@ -63,11 +63,9 @@
* component, otherwise</li> exceptin is thrown by the container.
* </ul>
* </p>
- *
- * @author <a href="mailto:gurkanerdogdu@yahoo.com">Gurkan Erdogdu</a>
+
* @since 1.0
*/
-@SuppressWarnings("unchecked")
public interface Manager
{
public <T> Set<Bean<T>> resolveByType(Class<T> type, Annotation... bindings);
@@ -79,6 +77,10 @@
public <T> T getInstanceByType(TypeLiteral<T> type, Annotation... bindingTypes);
public Set<Bean<?>> resolveByName(String name);
+
+ public <T> T getInstanceToInject(InjectionPoint injectionPoint, CreationalContext<?> context);
+
+ public <T> T getInstanceToInject(InjectionPoint injectionPoint);
public Object getInstanceByName(String name);