index
int64
0
0
repo_id
stringlengths
9
205
file_path
stringlengths
31
246
content
stringlengths
1
12.2M
__index_level_0__
int64
0
10k
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/Initialized.java
/* * 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.enterprise.context; import javax.inject.Qualifier; import java.lang.annotation.Annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Qualifier for events which get fired when a Context starts. * The exact point is after the Context gets set up, but before it * accepts storing Contextual Instances in it. * * Extensions should use a reasonable event object. * For built-in scopes the following event-classes will be used * <ul> * <li>&#064;RequestScoped: the ServletRequest for web requests, any other Object for other 'requests'</li> * <li>&#064;SessionScoped: the HttpSession</li> * <li>&#064;ApplicationScoped: ServletContext for web apps, any other Object for other apps</li> * <li>&#064;ConversationScoped: ServletRequest if handled during a web request, or any other Object for </li> * </ul> * * @see javax.enterprise.context.Destroyed * @since 1.1 */ @Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) @Documented @Qualifier public @interface Initialized { /** * @return the Scope annotation this is for. */ Class<? extends Annotation> value(); }
100
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/RequestScoped.java
/* * 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.enterprise.context; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Documented; import java.lang.annotation.Inherited; import java.lang.annotation.Retention; import java.lang.annotation.Target; /** * Defines the request scope. * * <p> * Please see <b>Request context lifecycle</b> of the specification * for further information. * </p> * * @version $Rev$ $Date$ */ @Target( { TYPE, METHOD, FIELD }) @Retention(RUNTIME) @Documented @NormalScope @Inherited public @interface RequestScoped { }
101
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/spi/AlterableContext.java
/* * 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.enterprise.context.spi; /** * A Context which allows to manually destroy the Contextual Instance * of the given Bean. * Contexts for NormalScoped beans should implement this * interface from CDI-1.1 on. */ public interface AlterableContext extends Context { public void destroy(Contextual<?> contextual); }
102
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/spi/Context.java
/* * 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.enterprise.context.spi; import java.lang.annotation.Annotation; import javax.enterprise.context.ContextNotActiveException; import javax.enterprise.context.NormalScope; /** * Every webbeans component has an associated context that are * defined by the {@link NormalScope} annotation. Webbeans components * that are contained in the context are managed by the webbeans container. * * <p> * Every context has a well-defined lifecycle. It means that * in some time, context is active and some other time context may * be passive. Moreover, each context is created and destroyed by the container * according to the timing requirements. For example, request context is started by every * http request and destroyed at the end of the http response. According to the current thread, * active context is called an thread current context. * </p> * * <p> * Context is responsible for creating and destroying the {@link Contextual} instances of the * webbeans components. * </p> * * @version $Rev$ $Date$ */ public interface Context { /** * Returns the scope type of the context. * * @return the scope type of the context */ public Class<? extends Annotation> getScope(); /** * If the context is not active, throws {@link ContextNotActiveException}. * Otherwise, it looks for the given component instance in the context map. If * this context contains the given webbeans component instance, it returns the component. * If the component is not found in this context map, it looks for the <code>creationalContext</code> * argument. If it is null, it returns null, otherwise new webbeans instance is created * and puts into the context and returns it. * * @param <T> type of the webbeans component * @param component webbeans component * @param creationalContext {@link CreationalContext} instance * @return the contextual instance or null */ public <T> T get(Contextual<T> component, CreationalContext<T> creationalContext); /** * Returns the instance of the webbeans in this context if exist otherwise return null. * * @param <T> type of the webbeans component * @param component webbeans component * @return the instance of the webbeans in this context if exist otherwise return null */ public <T> T get(Contextual<T> component); /** * Returns true if context is active according to the current thread, * returns false otherwise. * * @return true if context is active according to the current thread, * return false otherwise */ boolean isActive(); }
103
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/spi/CreationalContext.java
/* * 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.enterprise.context.spi; /** * <p>The <code>CreationalContext</code> holds incomplete Bean instances and * references to all{@link javax.enterprise.context.Dependent} scoped * contextual instances injected into a {@link javax.enterprise.context.NormalScope}d * bean.</p> * * <p>E.g. consider we create a Contextual Instance of a * {@link javax.enterprise.context.SessionScoped} <code>UserInformation</code> * bean which has a dependent injection point * (e.g. a field <code>private &#064;Inject Helper helper;</code> ) * In that case the CreationalContext of the <code>UserInformation</code> instance * will contain the information about the <code>helper</code> instance. * This is needed to properly destroy the <code>helper</code> once the * <code>UserInformation</code> gets destroyed. In our example this will * happen at the end of the Session. * </p> * * <p><b>Attention:</b> If you create a {@link javax.enterprise.context.Dependent} instance * manually using * {@link javax.enterprise.inject.spi.BeanManager#getReference(javax.enterprise.inject.spi.Bean, java.lang.reflect.Type, CreationalContext)} * then you must store away the CreationalContext. You will need it for properly destroying the created instance * via {@link javax.enterprise.inject.spi.Bean#destroy(Object, CreationalContext)}. * This is <i>not</i> needed for {@link javax.enterprise.context.NormalScope}d beans as they * maintain their lifecycle themself!</p> * * @version $Rev$ $Date$ */ public interface CreationalContext<T> { /** * Puts new incomplete instance into the creational context. * * @param incompleteInstance incomplete webbeans instance */ public void push(T incompleteInstance); /** * Destorys all dependent objects of the instance * that is being destroyed. */ public void release(); }
104
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/context/spi/Contextual.java
/* * 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.enterprise.context.spi; import javax.enterprise.inject.CreationException; /** * Each webbeans instance that is contained in the <code>Context</code> * must be defined as <code>Contextual</code>. * * This interface defines the creating and destroying of the webbeans instances * that are contained in the its {@link Context} instance. * * @param <T> type of the webbeans component * @see Context * * @version $Rev$ $Date$ */ public interface Contextual<T> { /** * Creates and returns a new instance of the webbeans component. * * @param context new creational context instance * @return the new instance of the webbeans component * @throws CreationException if any exception occurs */ public T create(CreationalContext<T> context); /** * Destroys the instance. Any destroy logic is encapsulated * in this method. * * @param instance already created webbeans instance * @param context creational context */ public void destroy(T instance, CreationalContext<T> context); }
105
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/util/AnnotationLiteral.java
/* * 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.enterprise.util; import java.io.Serializable; import java.lang.annotation.Annotation; import java.lang.reflect.AccessibleObject; import java.lang.reflect.Method; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Arrays; /** * Annotation literal utility. * * @param <T> wrapped annotation class * @version $Rev$ $Date$ */ @SuppressWarnings("unchecked") public abstract class AnnotationLiteral<T extends Annotation> implements Annotation, Serializable { private static final long serialVersionUID = -1885320698638161810L; private Class<T> annotationType; // cached values private transient Method[] _meths = null; private transient String _toString = null; private transient Integer _hashCode = null; private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0]; protected AnnotationLiteral() { this.annotationType = getAnnotationType(getClass()); } public Class<? extends Annotation> annotationType() { return annotationType; } private Class<T> getAnnotationType(Class<?> definedClazz) { Type superClazz = definedClazz.getGenericSuperclass(); Class<T> clazz = null; if (superClazz.equals(Object.class)) { throw new RuntimeException("Super class must be parametrized type!"); } else if (superClazz instanceof ParameterizedType) { ParameterizedType paramType = (ParameterizedType) superClazz; Type[] actualArgs = paramType.getActualTypeArguments(); if (actualArgs.length == 1) { //Actual annotation type Type type = actualArgs[0]; if (type instanceof Class) { clazz = (Class<T>) type; return clazz; } else { throw new RuntimeException("Not class type!"); } } else { throw new RuntimeException("More than one parametric type!"); } } else { return getAnnotationType((Class<?>) superClazz); } } @Override public boolean equals(Object other) { // use a private reference to prevent instance swapping as we don't use synchronization nor volatile on meths. Method[] methods = getMethods(); if(other == this) { return true; } if(other == null) { return false; } if (other instanceof Annotation) { Annotation annotOther = (Annotation) other; if (this.annotationType().equals(annotOther.annotationType())) { for (Method method : methods) { Object value = callMethod(this, method); Object annotValue = callMethod(annotOther, method); if((value == null && annotValue != null) || (value != null && annotValue == null)) { return false; } if(value == null && annotValue == null) { continue; } Class<?> valueClass = value.getClass(); Class<?> annotValueClass = annotValue.getClass(); if(valueClass.isPrimitive() && annotValueClass.isPrimitive()) { if((valueClass != Float.TYPE && annotValue != Float.TYPE) || (valueClass != Double.TYPE && annotValue != Double.TYPE)) { if(value != annotValue) { return false; } } } else if(valueClass.isArray() && annotValueClass.isArray()) { Class<?> type = valueClass.getComponentType(); if(type.isPrimitive()) { if(Long.TYPE == type) { if(!Arrays.equals(((Long[])value),(Long[])annotValue)) return false; } else if(Integer.TYPE == type) { if(!Arrays.equals(((Integer[])value),(Integer[])annotValue)) return false; } else if(Short.TYPE == type) { if(!Arrays.equals(((Short[])value),(Short[])annotValue)) return false; } else if(Double.TYPE == type) { if(!Arrays.equals(((Double[])value),(Double[])annotValue)) return false; } else if(Float.TYPE == type) { if(!Arrays.equals(((Float[])value),(Float[])annotValue)) return false; } else if(Boolean.TYPE == type) { if(!Arrays.equals(((Boolean[])value),(Boolean[])annotValue)) return false; } else if(Byte.TYPE == type) { if(!Arrays.equals(((Byte[])value),(Byte[])annotValue)) return false; } else if(Character.TYPE == type) { if(!Arrays.equals(((Character[])value),(Character[])annotValue)) return false; } } else { if(!Arrays.equals(((Object[])value),(Object[])annotValue)) return false; } } else if (value != null && annotValue != null) { if (!value.equals(annotValue)) { return false; } } } return true; } } return false; } private Object callMethod(Object instance, Method method) { boolean access = method.isAccessible(); try { if (!method.isAccessible()) { AccessController.doPrivileged(new PrivilegedActionForAccessibleObject(method, true)); } return method.invoke(instance, EMPTY_OBJECT_ARRAY); } catch (Exception e) { throw new RuntimeException("Exception in method call : " + method.getName(), e); } finally { AccessController.doPrivileged(new PrivilegedActionForAccessibleObject(method, access)); } } @Override public int hashCode() { if (_hashCode != null) { return _hashCode.intValue(); } Method[] methods = getMethods(); int hashCode = 0; for (Method method : methods) { // Member name int name = 127 * method.getName().hashCode(); // Member value Object object = callMethod(this, method); int value = 0; if(object.getClass().isArray()) { Class<?> type = object.getClass().getComponentType(); if(type.isPrimitive()) { if(Long.TYPE == type) { value = Arrays.hashCode((Long[])object); } else if(Integer.TYPE == type) { value = Arrays.hashCode((Integer[])object); } else if(Short.TYPE == type) { value = Arrays.hashCode((Short[])object); } else if(Double.TYPE == type) { value = Arrays.hashCode((Double[])object); } else if(Float.TYPE == type) { value = Arrays.hashCode((Float[])object); } else if(Boolean.TYPE == type) { value = Arrays.hashCode((Long[])object); } else if(Byte.TYPE == type) { value = Arrays.hashCode((Byte[])object); } else if(Character.TYPE == type) { value = Arrays.hashCode((Character[])object); } } else { value = Arrays.hashCode((Object[])object); } } else { value = object.hashCode(); } hashCode += name ^ value; } _hashCode = Integer.valueOf(hashCode); return hashCode; } @Override public String toString() { if (_toString != null) { return _toString; } Method[] methods = getMethods(); StringBuilder sb = new StringBuilder("@" + annotationType().getName() + "("); int lenght = methods.length; for (int i = 0; i < lenght; i++) { // Member name sb.append(methods[i].getName()).append("="); // Member value sb.append(callMethod(this, methods[i])); if (i < lenght - 1) { sb.append(","); } } sb.append(")"); _toString = sb.toString(); return _toString; } private Method[] getMethods() { if (_meths == null) { // no need to have meths volatile nor synchronized. // if invoked in parallel we only might call getMethods() a bit too often. _meths = (Method[]) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return annotationType.getDeclaredMethods(); } }); } return _meths; } protected static class PrivilegedActionForAccessibleObject implements PrivilegedAction<Object> { AccessibleObject object; boolean flag; protected PrivilegedActionForAccessibleObject(AccessibleObject object, boolean flag) { this.object = object; this.flag = flag; } public Object run() { object.setAccessible(flag); return null; } } }
106
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/util/Nonbinding.java
/* * 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.enterprise.util; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Retention; import java.lang.annotation.Target; /** * Indicates that <code>Qualifier</code> annotation member * is not contained in the type safe resolution algorithm. * * <p> * Example: * * <pre> * @Qualifier * public @interface Mock { * @NonBinding String name; * } * </pre> * * <b>Mock</b> qualifier <i>name</i> member variable is excepted from the * type safe resolution algorithm while comparing the qualifiers. * * </p> */ @Retention(RUNTIME) @Target(METHOD) public @interface Nonbinding { }
107
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/util/TypeLiteral.java
/* * 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.enterprise.util; import java.io.Serializable; import java.lang.reflect.GenericArrayType; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; /** * Type literal implementation. * @version $Rev$ $Date$ * * @param <T> wrapped type */ @SuppressWarnings("unchecked") public abstract class TypeLiteral<T> implements Serializable { private static final long serialVersionUID = 6993258591899719600L; private Type definedType; protected TypeLiteral() { this.definedType = getDefinedType(this.getClass()); } public final Type getType() { return definedType; } public final Class<T> getRawType() { Class<T> rawType = null; if (this.definedType instanceof Class) { rawType = (Class<T>) this.definedType; } else if (this.definedType instanceof ParameterizedType) { ParameterizedType pt = (ParameterizedType) this.definedType; rawType = (Class<T>) pt.getRawType(); } else if (this.definedType instanceof GenericArrayType) { rawType = (Class<T>) Object[].class; } else { throw new RuntimeException("Illegal type for the Type Literal Class"); } return rawType; } private Type getDefinedType(Class<?> clazz) { Type type = null; if (clazz == null) { throw new RuntimeException("Class parameter can not be null!"); } Type superClazz = clazz.getGenericSuperclass(); if (superClazz.equals(Object.class)) { throw new RuntimeException("Super class must be parametrized type!"); } else if (superClazz instanceof ParameterizedType) { ParameterizedType pt = (ParameterizedType) superClazz; Type[] actualArgs = pt.getActualTypeArguments(); if (actualArgs.length == 1) { type = actualArgs[0]; } else { throw new RuntimeException("More than one parametric type!"); } } else { type = getDefinedType((Class<?>) superClazz); } return type; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((definedType == null) ? 0 : definedType.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } TypeLiteral other = (TypeLiteral) obj; if (definedType == null) { if (other.definedType != null) { return false; } } else if (!definedType.equals(other.definedType)) { return false; } return true; } }
108
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/Any.java
/* * 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.enterprise.inject; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; import javax.inject.Qualifier; /** * Defines any qualifier in the injection point. * * @version $Rev$ $Date$ */ @Target( { TYPE, METHOD, FIELD, PARAMETER }) @Retention(RUNTIME) @Documented @Qualifier public @interface Any { }
109
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/CreationException.java
/* * 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.enterprise.inject; public class CreationException extends InjectionException { private static final long serialVersionUID = 1002854668862145298L; public CreationException() { super(); } public CreationException(String message) { super(message); } public CreationException(Throwable e) { super(e); } public CreationException(String message, Throwable e) { super(message, e); } }
110
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/Default.java
/* * 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.enterprise.inject; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; import javax.inject.Qualifier; /** * Default qualifier. * @version $Rev$ $Date$ * */ @Target( { TYPE, METHOD, PARAMETER, FIELD }) @Retention(RUNTIME) @Documented @Qualifier public @interface Default { }
111
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/Intercepted.java
/* * 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.enterprise.inject; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; import javax.inject.Qualifier; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.RetentionPolicy.RUNTIME; /** * A {@link javax.decorator.Decorator} can inject a {@link javax.enterprise.inject.spi.Bean} * with this qualifier to gather metadata about the decorated instance. */ @Target(value={PARAMETER,FIELD}) @Retention(value=RUNTIME) @Documented @Qualifier public @interface Intercepted { }
112
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/Disposes.java
/* * 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.enterprise.inject; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Disposes { }
113
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/Stereotype.java
/* * 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.enterprise.inject; import static java.lang.annotation.ElementType.ANNOTATION_TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; /** * Steretypes are used for inheriting the meta annotations * that are defined on the stereotyped annotation from another webbeans * component. * * <p> * If a bean annotated with multiple stereotypes, it obeys the all of the * stereotypes restrictions. * </p> * * @see Model */ @Retention(RUNTIME) @Target(ANNOTATION_TYPE) @Documented public @interface Stereotype { }
114
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/UnsatisfiedResolutionException.java
/* * 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.enterprise.inject; /** * If injection point is not resolved by the container, it throws * unsatisfied exception. * * @version $Rev$ $Date$ */ public class UnsatisfiedResolutionException extends ResolutionException { private static final long serialVersionUID = 5350603312442756709L; public UnsatisfiedResolutionException() { super(); } public UnsatisfiedResolutionException(String message) { super(message); } public UnsatisfiedResolutionException(Throwable e) { super(e); } public UnsatisfiedResolutionException(String message, Throwable e) { super(message, e); } }
115
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/InjectionException.java
/* * 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.enterprise.inject; /** * Injection exception class. * * @version $Rev$ $Date$ */ public class InjectionException extends RuntimeException { private static final long serialVersionUID = -2132733164534544788L; public InjectionException() { } public InjectionException(String message, Throwable e) { super(message, e); } public InjectionException(Throwable e) { super(e); } public InjectionException(String message) { super(message); } }
116
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/Decorated.java
/* * 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.enterprise.inject; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; import javax.inject.Qualifier; /** * A {@link javax.decorator.Decorator} can inject a {@link javax.enterprise.inject.spi.Bean} * with this qualifier to gather metadata about the decorated instance. */ @Target(value={PARAMETER,FIELD}) @Retention(value=RUNTIME) @Documented @Qualifier public @interface Decorated { }
117
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/Typed.java
/* * 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.enterprise.inject; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Used for definining explicit bean api types. * * @version $Rev$ $Date$ * */ @Target(value={ElementType.FIELD, ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Typed { Class<?>[] value() default {}; }
118
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/Specializes.java
/* * 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.enterprise.inject; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; @Target( { TYPE, METHOD }) @Retention(RUNTIME) @Documented public @interface Specializes { }
119
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/Produces.java
/* * 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.enterprise.inject; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; @Target({METHOD,FIELD}) @Retention(RUNTIME) @Documented public @interface Produces { }
120
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/UnproxyableResolutionException.java
/* * 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.enterprise.inject; /** * In DI, normal scope type bean class must be proxyable by the container. * If normal scoped bean is not proxyable by the container, it throws * this exception. * * @version $Rev$ $Date$ */ public class UnproxyableResolutionException extends ResolutionException { private static final long serialVersionUID = 1667539354548135465L; public UnproxyableResolutionException() { super(); } public UnproxyableResolutionException(String message) { super(message); } public UnproxyableResolutionException(Throwable e) { super(e); } public UnproxyableResolutionException(String message, Throwable e) { super(message, e); } }
121
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/Instance.java
/* * 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.enterprise.inject; import java.lang.annotation.Annotation; import javax.enterprise.util.TypeLiteral; import javax.inject.Provider; /** * The <code>Instance</code> interface provides a method for obtaining * instances of beans with required types and qualifiers. * * @version $Rev$ $Date$ * * @param <T> bean required type */ public interface Instance<T> extends Iterable<T>, Provider<T> { /** * Creates new <code>Instance</code> with given * qualifiers. * * @param qualifiers * @return new child instance with given qualifiers. */ public Instance<T> select(Annotation... qualifiers); /** * Returns new child instance with given class and qualifiers. * * @param <U> subtype info * @param subtype subtype class * @param qualifiers qualifiers * @return new child instance with given class and qualifiers */ public <U extends T> Instance<U> select(Class<U> subtype, Annotation... qualifiers); /** * Return new child instance with given class info and qualifiers. * * @param <U> subtype info * @param subtype subtype class * @param qualifiers qualifiers * @return new child instance with given class info and qualifiers */ public <U extends T> Instance<U> select(TypeLiteral<U> subtype, Annotation... qualifiers); /** * Return true if resulotion is unsatisfied, false otherwise. * * @return true if resulotion is unsatisfied, false otherwise */ public boolean isUnsatisfied(); /** * Returns true if resolution is ambigious, false otherwise. * * @return true if resolution is ambigious, false otherwise. */ public boolean isAmbiguous(); /** * Destroy the given Contextual Instance. * This is especially intended for {@link javax.enterprise.context.Dependent} scoped beans * which might otherwise create mem leaks. * @param instance */ public void destroy(T instance); }
122
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/IllegalProductException.java
/* * 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.enterprise.inject; /** * If return object of the producer method is null and its type * is primitive type then throws this exception. * * @version $Rev$ $Date$ */ public class IllegalProductException extends InjectionException { private static final long serialVersionUID = -6280627846071966243L; public IllegalProductException() { super(); } public IllegalProductException(String message) { super(message); } public IllegalProductException(Throwable e) { super(e); } public IllegalProductException(String message, Throwable e) { super(message, e); } }
123
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/AmbiguousResolutionException.java
/* * 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.enterprise.inject; /** * Ambigous resolution exception. It is thrown when more than one * bean exist for given injection point. * * @version $Rev$ $Date$ */ public class AmbiguousResolutionException extends ResolutionException { private static final long serialVersionUID = -2132733164534544788L ; public AmbiguousResolutionException() { super(); } public AmbiguousResolutionException(String message) { super(message); } public AmbiguousResolutionException(Throwable e) { super(e); } public AmbiguousResolutionException(String message, Throwable e) { super(message, e); } }
124
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/Vetoed.java
/* * 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.enterprise.inject; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Marks a class as to get ignored during CDI processing. * * If placed on a package, then exclude all the classes in that package. * If the same package is used in multiple classpath entries, non-portable behvaiour results. * * @since 1.1 */ @Target({ElementType.TYPE, ElementType.PACKAGE}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Vetoed { }
125
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/TransientReference.java
/* * 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.enterprise.inject; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; /** * Marks an injected parameter to be destroyed after invocation. * * When a constructor or a method is annotated with {@link javax.inject.Inject}, * its parameters may be annotated with <tt>\@TransientReference</tt>. * If a parameter is annotated with <tt>\@TransientReference</tt> * and the injected bean is {@link javax.enterprise.context.Dependent}-scoped, * it may be destroyed by the container right after the invocation * of the constructor or method. * * Technically spoken, the parameter will not be added to the * {@link javax.enterprise.context.spi.CreationalContext} * of the bean of the constructor or method, but will be created with a separate * {@link javax.enterprise.context.spi.CreationalContext} * that will be destroyed after the invocation. */ @Target(value = PARAMETER) @Retention(value = RUNTIME) @Documented public @interface TransientReference { }
126
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/New.java
/* * 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.enterprise.inject; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; import javax.inject.Qualifier; @Target( { FIELD, PARAMETER, METHOD, TYPE}) @Retention(RUNTIME) @Documented @Qualifier public @interface New { /** * <p>May be used to declare a class which should be used for injection. * This defaults to the type which is defined at the injection point.</p> * * <p>Technically this is a qualifier, but it has a very special handling * defined by the specification. It will create a new Contextual Instance * of the given class by calling the default constructor. The created * Contextual Instance will be treated as being &#064;Dependent to the * instance the injection point belongs to.</p> * * <p>&#064;New also works for creating Contextual Instances of classes which are * <i>not</i> part of a bean archive (BDA, aka a jar with a META-INF/beans.xml). * Note that from a practical point &#064;New is rarely useful. If you don't have * a beans.xml then you will most probably also not have any CDI feature in that class. * and if you otoh do have such a BDA, then you can inject the bean directly anyway. * The only real usage is to inject a new 'dependent' instance of a CDI bean which * has a different scope already defined. * * <p> * Example: * <pre> * &#064;Inject &#064;New SomeClass instance; * </pre> * </p> * * <p><b>Attention:</b> &#064;New only works for InjectionPoints, it is not * possible to resolve a new-bean programatically via * {@link javax.enterprise.inject.spi.BeanManager#getBeans(java.lang.reflect.Type, java.lang.annotation.Annotation...)} * if there was no &#064;New InjectionPoint of that type in the scanned classes.</p> * * @return the class of the bean which should be injected */ Class<?> value() default New.class; }
127
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/Alternative.java
/* * 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.enterprise.inject; import static java.lang.annotation.RetentionPolicy.RUNTIME; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.FIELD; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME) @Documented public @interface Alternative { }
128
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/Model.java
/* * 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.enterprise.inject; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; import javax.enterprise.context.RequestScoped; import javax.inject.Named; @Named @RequestScoped @Stereotype @Target( { TYPE, METHOD, FIELD }) @Retention(RUNTIME) @Documented public @interface Model { }
129
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/ResolutionException.java
/* * 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.enterprise.inject; /** * Resolution exception class. * * @version $Rev$ $Date$ */ public class ResolutionException extends InjectionException { private static final long serialVersionUID = -6280627846071966243L; public ResolutionException() { } public ResolutionException(String message, Throwable e) { super(message, e); } public ResolutionException(Throwable e) { super(e); } public ResolutionException(String message) { super(message); } }
130
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/Interceptor.java
/* * 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.enterprise.inject.spi; import java.lang.annotation.Annotation; import java.util.Set; import javax.interceptor.InvocationContext; /** * A Bean for creating and using an interceptor. * A CDI interceptor is always a separate dependent instance * for each intercepted class. It will get created when the * intercepted bean gets created and destroyed when the * intercepted bean gets destroyed. * * @param <T> */ public interface Interceptor<T> extends Bean<T> { /** * Usually a single Interceptor * @return all {@link javax.interceptor.InterceptorBinding}s handled by this interceptor. */ public abstract Set<Annotation> getInterceptorBindings(); /** * @param type InterceptionType in question * @return <code>true</code> if this interceptor handles the given InterceptionType, <code>false</code> otherwise */ public boolean intercepts(InterceptionType type); /** * Perform the interception. This will e.g. invoke the &#064;AroundInvoke annotated method * on the given instance of T. * @param type the InterceptionType. This is important if an interceptor has multiple interceptor methods * e.g. one &#064;AroundInvoke and one &#064;PostConstruct; * @param instance the interceptor instance * @param ctx the InvocationContext contains all the interceptor chain state for a single invocation. * @return the object or wrapper type returned by the intercepted instance or the previous interceptor * (if this is not the last interceptor in the chain) * @throws Exception wrapped from the intercepted instance. See CDI-115 */ public Object intercept(InterceptionType type, T instance, InvocationContext ctx) throws Exception; }
131
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/PassivationCapable.java
/* * 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.enterprise.inject.spi; public interface PassivationCapable { public String getId(); }
132
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/AnnotatedMethod.java
/* * 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.enterprise.inject.spi; import java.lang.reflect.Method; /** * Define method member contract. * * @version $Rev$ $Date$ * * @param <X> declaring type */ public interface AnnotatedMethod<X> extends AnnotatedCallable<X> { /** * {@inheritDoc} */ public Method getJavaMember(); }
133
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/InjectionTargetFactory.java
/* * 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.enterprise.inject.spi; /** * A factory which is able to create container provided * {@link InjectionTarget}s. */ public interface InjectionTargetFactory<T> { /** * Creates an InjectionTarget for the given Bean * @param bean the Bean or <code>null</code> if the InjectionTarget should not get managed by the container. */ public InjectionTarget<T> createInjectionTarget(Bean<T> bean); }
134
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/Extension.java
/* * 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.enterprise.inject.spi; /** * Marker interface that is implemented by the classes * that listen for the container events. * * @version $Rev$ $Date$ * */ public interface Extension { }
135
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/WithAnnotations.java
/* * 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.enterprise.inject.spi; import java.lang.annotation.Annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * This allows for applying an annotation filter to * {@link javax.enterprise.inject.spi.ProcessAnnotatedType}. * * Sample usage: * <pre> * public void processWindowBeans(&#064;Observes &#064;WithAnnotation(WindowBean.class) ProcessAnnotatedType pat) {..} * </pre> * This Extension method e.g. will get fired for all classes which have a <code>&#064;WindowBean</code> annotation. * * @since 1.1 */ @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface WithAnnotations { /** * @return the annotations the {@link javax.enterprise.inject.spi.ProcessAnnotatedType} should get filtered for */ Class<? extends Annotation>[] value(); }
136
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/ProducerFactory.java
/* * 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.enterprise.inject.spi; /** * A factory which is able to create container provided * {@link Producer}s. */ public interface ProducerFactory<X> { /** * Creates a Producer for the given Bean * @param bean the Bean or <code>null</code> if the Producer should not get managed by the container. */ public <T> Producer<T> createProducer(Bean<T> bean); }
137
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/InjectionTarget.java
/* * 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.enterprise.inject.spi; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.enterprise.context.spi.CreationalContext; /** * Provides operations for performing dependency injection and lifecycle * callbacks on an instance of a type. * * @version $Rev$ $Date$ * * <T> bean type */ public interface InjectionTarget<T> extends Producer<T> { /** * Performs dependency injection upon the given object. * * @param instance bean instance * @param ctx creational context */ public void inject(T instance, CreationalContext<T> ctx); /** * Calls {@link PostConstruct} callback method if exists. * * @param instance bean instance */ public void postConstruct(T instance); /** * Calls {@link PreDestroy} callback method if exists. * * @param instance bean instance */ public void preDestroy(T instance); }
138
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/Annotated.java
/* * 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.enterprise.inject.spi; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Set; /** * Describes annotated member properties. * * @version $Rev$ $Date$ */ public interface Annotated { /** * Returns type of the element. * * @return type of the element */ public Type getBaseType(); /** * Returns set of type closures. Type closure means * that {@link Annotated#getBaseType()} is assignable. * * @return set of type closures. */ public Set<Type> getTypeClosure(); /** * Gets annotated element's annotation member if exist, null otherwise * * @param <T> generic annotatation class type * @param annotationType class of the annotation * @return annotated element's annotation member if exist, null otherwise */ public <T extends Annotation> T getAnnotation(Class<T> annotationType); /** * Gets annotated member all annotations. * * @return annotated member annotations */ public Set<Annotation> getAnnotations(); /** * Returns true if annotated member has annotation for given annotation type, * false otherwise. * * @param annotationType type of the annotation * @return true if annotated member has annotation for given annotation type */ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType); }
139
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/BeforeShutdown.java
/* * 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.enterprise.inject.spi; /** * Event is fired before shut down of the * container. * * @version $Rev$ $Date$ * */ public interface BeforeShutdown { }
140
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/AnnotatedConstructor.java
/* * 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.enterprise.inject.spi; import java.lang.reflect.Constructor; /** * Defines member constructor contract. * * @version $Rev$ $Date$ * * @param <X> declaring type */ public interface AnnotatedConstructor<X> extends AnnotatedCallable<X> { /** * {@inheritDoc} */ public Constructor<X> getJavaMember(); }
141
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/CDI.java
/* * 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.enterprise.inject.spi; import javax.enterprise.inject.Instance; import java.util.ServiceLoader; /** * <p>Static helper class to access the {@link BeanManager}</p> * * TODO not yet implemented! * * <p>Usage: * <pre> * BeanManager bm = CDI.current().getBeanManager(); * </pre> * </p> * * * @since 1.1 */ public abstract class CDI<T> implements Instance<T> { private static volatile CDI INSTANCE; // temporary implementation public static CDI<Object> current() { if (INSTANCE == null) { INSTANCE = ServiceLoader.load(CDIProvider.class).iterator().next().getCDI(); } return INSTANCE; //X TODO implement! } /** * <p>A container or an application can set this manually. If not * we will use the {@link java.util.ServiceLoader} and use the * first service we find.</p> * * TODO: clarify if this is per 'application' or general? * * @param provider to use */ public static void setCDIProvider(CDIProvider provider) { //X TODO implement! if (provider == null) { INSTANCE = null; } else { INSTANCE = provider.getCDI(); } } public abstract BeanManager getBeanManager(); }
142
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/AnnotatedParameter.java
/* * 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.enterprise.inject.spi; /** * Defines member parameter contract. * * @version $Rev$ $Date$ * * @param <X> declaring type */ public interface AnnotatedParameter<X> extends Annotated { /** * Returns parameter position. * * @return parameter position */ public int getPosition(); /** * Returns declaring callable member. * * @return declaring callable member */ public AnnotatedCallable<X> getDeclaringCallable(); }
143
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/Decorator.java
/* * 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.enterprise.inject.spi; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Set; /** * Decorator Bean. */ public interface Decorator<T> extends Bean<T> { /** * All the interfaces and classes in the type hierarchy of the * class annotated with &#064;{@link javax.decorator.Decorator}. * @return the decorated types of the decorator. */ public abstract Set<Type> getDecoratedTypes(); /** * @return the Type of the &#064;{@link javax.decorator.Delegate} injection point. */ public abstract Type getDelegateType(); /** * @return the Qualifiers of the &#064;{@link javax.decorator.Delegate} injection point. */ public abstract Set<Annotation> getDelegateQualifiers(); }
144
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/AfterTypeDiscovery.java
/* * 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.enterprise.inject.spi; import java.util.List; /** * This event will get fired after the container has completed the * class scanning process and all AnnotatedTypes got discovered * from the classpath. */ public interface AfterTypeDiscovery { /** * This method can be used to remove and add {@link javax.enterprise.inject.Alternative}s, * but also to change the sorting order * {@link javax.enterprise.inject.Alternative}s which are only enabled in a certain * BeanArchive are not included in this list. * @return the ordered, mutable List of enabled {@link javax.enterprise.inject.Alternative}s */ public List<Class<?>> getAlternatives(); /** * This method can be used to remove and add enabled CDI Interceptors, * but also to change the sorting order. * Interceptors which are only enabled in a certain BeanArchive are not included in this list. * @return the ordered, mutable List of Classes which are annotated with {@link Interceptor} * and globally enabled. */ public List<Class<?>> getInterceptors(); /** * This method can be used to remove and add enabled Decorators, * but also to change the sorting order. * Decorators which are only enabled in a certain BeanArchive are not included in this list. * @return the ordered, mutable List of Classes which are annotated with {@link Decorator} * and globally enabled. */ public List<Class<?>> getDecorators(); /** * Allows to a synthetic annotated type. * This method shall get used if you like to add a new * AnnotatedType for a class which already gets scanned by the container. * You should provide an unique id if there is already another AnnotatedType * for the same class. * * The AnnotatedTypes added via this method will not get passed * to Extensions via {@link ProcessAnnotatedType} but only via * {@link ProcessSyntheticAnnotatedType} * * @param type * @param id the unique id or <code>null</code> * * @see AfterBeanDiscovery#getAnnotatedType(Class, String) * @see AfterBeanDiscovery#getAnnotatedTypes(Class) * */ public void addAnnotatedType(AnnotatedType<?> type, String id); }
145
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/BeanAttributes.java
/* * 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.enterprise.inject.spi; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Set; /** * Defines the mutable parts of the {@link Bean} interface. * * @since 1.1‚ */ public interface BeanAttributes<T> { /** * Returns api types of a bean. * * @return api types of a bean */ public abstract Set<Type> getTypes(); /** * Returns qualifiers of a bean. * * @return qualifiers of a bean */ public abstract Set<Annotation> getQualifiers(); /** * Returns scope of a bean. * * @return scope */ public abstract Class<? extends Annotation> getScope(); /** * Returns name of a bean. * * @return name of a bean */ public abstract String getName(); /** * Returns bean stereotypes. * * @return bean stereotypes */ public Set<Class<? extends Annotation>> getStereotypes(); /** * Returns true if declares as policy * * @return true if declares as policy */ public boolean isAlternative(); }
146
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/ProcessProducerField.java
/* * 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.enterprise.inject.spi; /** * Fired before registering producer field. * * @version $Rev$ $Date$ * * @param <X> bean class * @param <T> producer field return type */ public interface ProcessProducerField<X, T> extends ProcessBean<T> { /** * Returns annotated field. * * @return annotated field. */ public AnnotatedField<X> getAnnotatedProducerField(); /** * @return the {@link javax.enterprise.inject.Disposes} annotated parameter of the disposal method * which fits the producer field, or <code>null</code> if there is no disposal method. */ public AnnotatedParameter<X> getAnnotatedDisposedParameter(); }
147
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/Unmanaged.java
/* * 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.enterprise.inject.spi; import javax.enterprise.context.spi.CreationalContext; /** * Helper class for manually maintaining CDI created instances * which are not managed by the CDI container. * * Be aware that instances created that way are <i>not</i> * managed by the CDI container and thus need to be * cleaned up manually to not create memory leaks!. * * Normal code shall use {@link javax.enterprise.inject.Instance<T>} if possible. * * The reason for using UnmanagedInstance is for * &#064;Dependent scoped instances which should not pollute the * {@link javax.enterprise.context.spi.CreationalContext} of the containing instance. * * Note that the methods of UnmanagedInstance needs to be called * in a well defined order. * * Please note that this classes are not thread safe! * * @param <T> the type of the CDI instance to create * @since 1.1 */ public class Unmanaged<T> { private BeanManager beanManager; private InjectionTarget<T> injectionTarget; public Unmanaged(Class<T> clazz) { this(CDI.current().getBeanManager(), clazz); } public Unmanaged(BeanManager beanManager, java.lang.Class<T> clazz) { this.beanManager = beanManager; AnnotatedType<T> annotatedType = beanManager.createAnnotatedType(clazz); injectionTarget = beanManager.createInjectionTarget(annotatedType); } public UnmanagedInstance<T> newInstance() { return new UnmanagedInstance<T>(beanManager, injectionTarget); } /** * This basically delegates to the {@link javax.enterprise.inject.spi.InjectionTarget} * interface * @param <T> the type of the CDI instance to create */ public static class UnmanagedInstance<T> { private BeanManager beanManager; private InjectionTarget<T> injectionTarget; private CreationalContext<T> creationalContext; private T instance; private boolean injected = false; private boolean disposed = false; private UnmanagedInstance(BeanManager beanManager, InjectionTarget<T> injectionTarget) { this.injectionTarget = injectionTarget; this.beanManager = beanManager; } /** * Create the CDI instance itself. This internally just calls * {@link javax.enterprise.inject.spi.InjectionTarget#produce(javax.enterprise.context.spi.CreationalContext)} * and performs a few checks upfront. * * @throws java.lang.IllegalStateException if the instance already got created * @throws java.lang.IllegalStateException if the instance already got disposed */ public UnmanagedInstance<T> produce() { if (creationalContext != null) { throw new IllegalStateException("UnmanagedInstance is already produced"); } if (disposed) { throw new IllegalStateException("UnmanagedInstance is already disposed"); } creationalContext = beanManager.createCreationalContext(null); instance = injectionTarget.produce(creationalContext); return this; } /** * Fill &#064;inject field, constructor and methods. * * @throws java.lang.IllegalStateException if the instance was not yet created * @throws java.lang.IllegalStateException if the instance already got injected * @throws java.lang.IllegalStateException if the instance already got disposed * @see javax.enterprise.inject.spi.InjectionTarget#inject(Object, javax.enterprise.context.spi.CreationalContext) */ public UnmanagedInstance<T> inject() { basicCheck(); if (injected) { throw new IllegalStateException("UnmanagedInstance is already injected"); } injectionTarget.inject(instance, creationalContext); injected = true; return this; } /** * Invoke any &#064;PostConstruct methods. * @see javax.enterprise.inject.spi.InjectionTarget#postConstruct(Object) */ public UnmanagedInstance<T> postConstruct() { basicCheck(); injectionTarget.postConstruct(instance); return this; } /** * This method should only get called after the * CDI instance got properly produced and initialized * via * {@link #produce()} * {@link #inject()} * {@link #postConstruct()} * * @return the filled cdi instance */ public T get() { basicCheck(); return instance; } /** * Invoke any &#064;PreDestroy annotated methods * and interceptors of the given CDI instance. */ public UnmanagedInstance<T> preDestroy() { basicCheck(); injectionTarget.preDestroy(instance); return this; } /** * Dispose the CDI instance. One should call {@link #preDestroy()} before * this method. * @see javax.enterprise.inject.spi.InjectionTarget#dispose(Object) */ public UnmanagedInstance<T> dispose() { basicCheck(); injectionTarget.dispose(instance); creationalContext.release(); return this; } /** * Check whether the UnmanagedInstance is already initialized and not yet disposed. */ private void basicCheck() { if (creationalContext == null) { throw new IllegalStateException("UnmanagedInstance is not yet initialized. Invoke #produce() first!"); } if (disposed) { throw new IllegalStateException("UnmanagedInstance is already disposed"); } } } }
148
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/AnnotatedCallable.java
/* * 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.enterprise.inject.spi; import java.util.List; /** * Defines callables member contract. * * @version $Rev$ $Date$ * * @param <X> declaring type */ public interface AnnotatedCallable<X> extends AnnotatedMember<X> { /** * Returns callable list of parameter or empty if none. * * @return list of parameters */ public List<AnnotatedParameter<X>> getParameters(); }
149
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/ProcessAnnotatedType.java
/* * 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.enterprise.inject.spi; /** * Event is fired before reading any annotations on the class. * * @version $Rev$ $Date$ * * <X> class type */ public interface ProcessAnnotatedType<X> { /** * Gets annotated type. * * @return annotated type */ public AnnotatedType<X> getAnnotatedType(); /** * Replaces annotated type. * * @param type annotated type */ public void setAnnotatedType(AnnotatedType<X> type); /** * Veto registering process. */ public void veto(); }
150
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java
/* * 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.enterprise.inject.spi; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Set; import javax.enterprise.event.Reception; import javax.enterprise.event.TransactionPhase; /** * <p>ObserverMethod is the SPI to handle an observer method, which is * an event consumer for an event of the given type T. An instance of * ObserverMethod exists for every observer method of every enabled bean.</p> * * <p>A class may have n observer methods.</p> * <p>Each observer method must have a void return value and exactly one parameter * which defines which event it {@code javax.enterprise.event.Observes}. * The observed event may be further specified by using an optional Qualifier.</p> * * Sample: * <pre> * public class UserHandler * { * public void afterUserLogin(@Observes UserLoginEvent userHasLoggedIn) * { * // prepare some data for the user, ... * int userId = userHadLoggedIn.getUserId(); * ... * } * * public void afterAdminLogin(@Observes @Admin UserLoginEvent userHasLoggedIn) * { * // prepare stuff for the admin user * ... * } * * public void afterUserLogout(@Observes UserLogoutEvent userHasLoggedOut) * { * // cleanup afterwards * ... * } * } * </pre> * * @param <T> the event which should be observed * @see javax.enterprise.event.Observes */ public interface ObserverMethod<T> { public Class<?> getBeanClass(); /** * @return the type of the observed event */ public Type getObservedType(); /** * @return the defined Qualifiers plus {@code javax.enterprise.inject.Any} */ public Set<Annotation> getObservedQualifiers(); /** * @return either {@code Reception#IF_EXISTS} if the observed method must only be called if an instance * of the bean which defines the observer method aready exists in the specified context or {@code Reception#ALWAYS}. */ public Reception getReception(); /** * @return the appropriate {@code TransactionPhase} for a transactional observer method or * {@code TransactionPhase#IN_PROGRESS} otherwise. */ public TransactionPhase getTransactionPhase(); /** * will actually cann the underlying observer method * @param event */ public void notify(T event); }
151
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/ProcessProducer.java
/* * 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.enterprise.inject.spi; /** * Container fires this event for each * producer field/method including resources. * * @version $Rev$ $Date$ * * @param <X> bean class info * @param <T> producer return type */ public interface ProcessProducer<X, T> { /** * Returns annotated member. * * @return annotated member */ public AnnotatedMember<X> getAnnotatedMember(); /** * Returns producer instance. * * @return producer instance */ public Producer<T> getProducer(); /** * Replaces producer instance. * * @param producer new producer */ public void setProducer(Producer<T> producer); /** * Adding definition error. Container aborts processing. * * @param t throwable */ public void addDefinitionError(Throwable t); }
152
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/InjectionPoint.java
/* * 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.enterprise.inject.spi; import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Member; import java.lang.reflect.Method; import java.lang.reflect.Type; import java.util.Set; /** * An InjectionPoint object provides metadata information about an injection point. * An instance of InjectionPoint may represent one of the following types: * <ul> * <li>an injected field</li> * <li>a parameter of a bean constructor</li> * <li>an initializer method</li> * <li>a producer method</li> * <li>a disposer method</li> * <li>an observer method</li> * </ul> * * @version $Rev$ $Date$ */ public interface InjectionPoint { /** * Returns required type of the injection point. * * @return type of the injection point */ public Type getType(); /** * Returns required qualifiers of the injection point. * * @return qualifiers at the injection point */ public Set<Annotation> getQualifiers(); /** * Returns the injection point owner bean. * <p> * If there is no bean for the injection point, * it returns null. * </p> * * @return injection point owner bean */ public Bean<?> getBean(); /** * Returns appered point for injection point. One of * <ul> * <li>{@link Field} object</li> * <li>{@link Constructor} parameter</li> * <li>{@link Method} producer method parameter</li> * <li>{@link Method} disposal method parameter</li> * <li>{@link Method} observer method parameter</li> * </ul> * * @return where the injection point is appeared */ public Member getMember(); /** * Returns annotated object representation of member. * * @return annotated */ public Annotated getAnnotated(); /** * Returns true if injection point is decorator delegate, * false otherwise. * * @return true if injection point is decorator delegate */ public boolean isDelegate(); /** * Returns true if injection point is transient, * false otherwise. * * @return true if injection point is transient */ public boolean isTransient(); }
153
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/ProcessBeanAttributes.java
/* * 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.enterprise.inject.spi; /** * Each {@link AnnotatedType} gets scanned by the CDI container and turned * into initial {@link BeanAttributes}. Those BeanAttributes can be modified * by observing this very ProcessBeanAttributes system event. * The modified BeanAttributes will get used to construct the final {@link Bean}. * */ public interface ProcessBeanAttributes<T> { /** * @return the {@link AnnotatedType} for bean classes, {@link AnnotatedMethod} for producer methods and * {@link AnnotatedField} for producer fields. */ public Annotated getAnnotated(); /** * @return the BeanAttributes parsed from the {@link Annotated} */ public BeanAttributes<T> getBeanAttributes(); /** * Use the given BeanAttributes to later create the {@link Bean} from it. * @param beanAttributes */ public void setBeanAttributes(BeanAttributes<T> beanAttributes); /** * Tell the container it should ignore this Bean. */ public void veto(); /** * Adding definition error. Container aborts * processing after calling all observers. * * @param t throwable */ public void addDefinitionError(Throwable t); }
154
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java
/* * 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.enterprise.inject.spi; import java.util.Set; /** * Defines alternative meta data for bean class. * * @version $Rev$ $Date$ */ public interface AnnotatedType<X> extends Annotated { /** * Returns class of bean. * * @return class of bean */ public Class<X> getJavaClass(); /** * Returns set of bean constructors. * * @return set of constructors */ public Set<AnnotatedConstructor<X>> getConstructors(); /** * Returns set of bean methods. * * @return set of bean methods */ public Set<AnnotatedMethod<? super X>> getMethods(); /** * Returns set of bean fields. * * @return set of bean fields. */ public Set<AnnotatedField<? super X>> getFields(); }
155
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/InterceptionType.java
/* * 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.enterprise.inject.spi; public enum InterceptionType { AROUND_INVOKE, AROUND_TIMEOUT, AROUND_CONSTRUCT, POST_CONSTRUCT, PRE_DESTROY, PRE_PASSIVATE, POST_ACTIVATE, }
156
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/DeploymentException.java
/* * 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.enterprise.inject.spi; /** * A DeploymentException occurs if there are problems in resolving dependencies or * inconsistent specialization in a specific deployment. * This Exception will only get thrown at container startup. * * @see DefinitionException */ public class DeploymentException extends RuntimeException { private static final long serialVersionUID = 1L; public DeploymentException() { } public DeploymentException(Throwable cause) { super(cause); } public DeploymentException(String message) { super(message); } public DeploymentException(String message, Throwable cause) { super(message, cause); } }
157
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/AnnotatedMember.java
/* * 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.enterprise.inject.spi; import java.lang.reflect.Member; /** * Defines annotated members common contract. * * <p> * Annotated members could be one of the followings * <ul> * <li>Class Fields</li> * <li>Class Methods</li> * <li>Class Constructors</li> * <li>Constructor or method Parameters</li> * </ul> * </p> * fields, constructors, methods. * * @version $Rev$ $Date$ * */ public interface AnnotatedMember<X> extends Annotated { /** * Returns base java member. * * @return java member */ public Member getJavaMember(); /** * Returns true if member modifiers contain static keyword * false otherwise. * * @return true if member modifiers contain static keyword */ public boolean isStatic(); /** * Returns member's declaring type. * * @return member's declaring type */ public AnnotatedType<X> getDeclaringType(); }
158
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/AfterBeanDiscovery.java
/* * 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.enterprise.inject.spi; import javax.enterprise.context.spi.Context; /** * Events that are fired after discovery bean process. * * @version $Rev$ $Date$ * */ public interface AfterBeanDiscovery { /** * Adds definition error. Container aborts deployment after * all observer methods are called. * * @param t throwable */ public void addDefinitionError(Throwable t); /** * Registering the bean with container. * * @param bean new bean */ public void addBean(Bean<?> bean); /** * Registers the given observer method with container. * * @param observerMethod observer method */ public void addObserverMethod(ObserverMethod<?> observerMethod); /** * Adds given context to the container. * * @param context new context */ public void addContext(Context context); /** * This will return the AnnotatedType including all changes applied by CDI Extensions. * * @param type * @param id the id of the AnnotatedType registered by {@link BeforeBeanDiscovery#addAnnotatedType(AnnotatedType, String)} * or <code>null</code> for the one scanned * @param <T> * @return the AnnotatedType for the given type and id. */ public <T> AnnotatedType<T> getAnnotatedType(Class<T> type, String id); /** * Get an Iterable of all AnnotatedTypes which implement the given * @param type * @param <T> * @return */ public <T> Iterable<AnnotatedType<T>> getAnnotatedTypes(Class<T> type); }
159
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/ProcessBean.java
/* * 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.enterprise.inject.spi; /** * Fires event before registering bean with container. * * @version $Rev$ $Date$ * * @param <X> bean class */ public interface ProcessBean<X> { /** * Returns annotated. * * @return annotated */ public Annotated getAnnotated(); /** * Returns bean instance. * * @return bean */ public Bean<X> getBean(); /** * Aborts processing. * * @param t throwable */ public void addDefinitionError(Throwable t); }
160
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/SessionBeanType.java
/* * 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.enterprise.inject.spi; /** * Session bean type enumerations. * * @version $Rev$ $Date$ * */ public enum SessionBeanType { STATELESS, STATEFUL, SINGLETON }
161
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/EventMetadata.java
/* * 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.enterprise.inject.spi; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Set; /** * An Observer Method can inject an {@link javax.enterprise.context.Dependent} * EventMetadata object containing information about the * sender of the event. */ public interface EventMetadata { /** * @return the qualifiers which were used to fire the event */ public Set<Annotation> getQualifiers(); /** * @return the {@link javax.enterprise.event.Event} InjectionPoitn or <code>null</code> * if this event got fired via {@link BeanManager#fireEvent(Object, java.lang.annotation.Annotation...)} */ public InjectionPoint getInjectionPoint(); /** * @return the effective type of the fired event */ public Type getType(); }
162
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/BeanManager.java
/* * 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.enterprise.inject.spi; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; import java.util.List; import java.util.Set; import javax.el.ELResolver; import javax.el.ExpressionFactory; import javax.enterprise.context.spi.Context; import javax.enterprise.context.spi.Contextual; import javax.enterprise.context.spi.CreationalContext; import javax.enterprise.inject.AmbiguousResolutionException; import javax.enterprise.inject.InjectionException; import javax.enterprise.inject.UnsatisfiedResolutionException; /** * <p>The interface <code>BeanManager</code> is the central point for dealing with CDI. * The BeanManager provides operations for resolving CDI {@link Bean}s, * obtaining the Contextual References of them, etc. There are operations * related with;</p> * * <ul> * <li>Firing observer events</li> * <li>Creating {@link CreationalContext}s</li> * <li>Resolution of beans, interceptors, decorators and observers</li> * <li>Other utility methods etc..</li> * </ul> * */ public interface BeanManager { /** * Returns a bean instance reference for the given bean. * * @param bean bean that its reference is getting * @param beanType bean api type that is implemented by the proxy * @param ctx creational context is used to destroy any object with scope <code>@Dependent</code> * @return bean reference * @throws IllegalArgumentException if given bean type is not api type of the given bean object * @throws java.lang.IllegalStateException if this method gets called before the AfterDeploymentValidation event is fired. */ public Object getReference(Bean<?> bean, Type beanType, CreationalContext<?> ctx); /** * Gets injection point bean reference. * * @param injectionPoint injection point definition * @param ctx creational context that is passed to the {@link Bean#create(CreationalContext)} method * @return bean reference * @throws UnsatisfiedResolutionException if no bean found for the given injection point * @throws AmbiguousResolutionException if more than one bean found * @throws java.lang.IllegalStateException if this method gets called before the AfterDeploymentValidation event is fired. */ public Object getInjectableReference(InjectionPoint injectionPoint, CreationalContext<?> ctx); /** * Returns a new creational context implementation. * * @return new creational context */ public <T> CreationalContext<T> createCreationalContext(Contextual<T> contextual); /** * Returns set of beans that their api types contain * given bean type and given qualifiers. * * <p> * If no qualifier is given, <code>@Current</code> is assumed. * </p> * * @param beanType required bean type * @param qualifiers required qualifiers * @return set of beans * @throws IllegalArgumentException given bean type is a {@link TypeVariable} * @throws IllegalArgumentException given qualifier annotation is not a qualifier * @throws IllegalArgumentException same qualifier is given * @throws java.lang.IllegalStateException if this method gets called before the AfterBeanDiscovery event is fired. */ public Set<Bean<?>> getBeans(Type beanType, Annotation... qualifiers); /** * Returns set of beans with given Expression Language name. * * @param name name of the bean * @return set of beans with given name * @throws java.lang.IllegalStateException if this method gets called before the AfterBeanDiscovery event is fired. */ public Set<Bean<?>> getBeans(String name); /** * Returns passivation capable bean given id. * * @param id bean id * @return passivation capable bean given id * @throws java.lang.IllegalStateException if this method gets called before the AfterBeanDiscovery event is fired. */ public Bean<?> getPassivationCapableBean(String id); /** * Returns a bean object that is resolved according to the type safe resolution rules. * * @param <X> bean class info * @param beans set of beans * @return bean that is resolved according to the type safe resolution rules * @throws AmbiguousResolutionException if ambigious exists * @throws java.lang.IllegalStateException if this method gets called before the AfterBeanDiscovery event is fired. */ public <X> Bean<? extends X> resolve(Set<Bean<? extends X>> beans); /** * Fires an event with given even object and qualifiers. * * @param event observer event object * @param qualifiers event qualifiers * @throws IllegalArgumentException event object contains a {@link TypeVariable} * @throws IllegalArgumentException given qualifier annotation is not a qualifier * @throws IllegalArgumentException same qualifier is given */ public void fireEvent(Object event, Annotation... qualifiers); /** * Returns set of observer methods. * * @param <T> event type * @param event even object * @param qualifiers event qualifiers * @return set of observer methods * @throws java.lang.IllegalStateException if this method gets called before the AfterBeanDiscovery event is fired. */ public <T> Set<ObserverMethod<? super T>> resolveObserverMethods(T event, Annotation... qualifiers); /** * Returns a list of decorator. * * @param types bean types of the decorated bean * @param qualifiers decorated bean qualifiers * @return list of decorator * @throws IllegalArgumentException given qualifier annotation is not a qualifier * @throws IllegalArgumentException same qualifier is given * @throws IllegalArgumentException if types is empty set * @throws java.lang.IllegalStateException if this method gets called before the AfterBeanDiscovery event is fired. */ List<Decorator<?>> resolveDecorators(Set<Type> types, Annotation... qualifiers); /** * Returns a list of interceptor. * * @param type interception type * @param interceptorBindings interceptor bindings * @return list of interceptor * @throws IllegalArgumentException given binding annotation is not a binding * @throws IllegalArgumentException same binding is given * @throws IllegalArgumentException binding is not an interceptor binding * @throws java.lang.IllegalStateException if this method gets called before the AfterBeanDiscovery event is fired. */ List<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings); /** * Validates injection point. * * @param injectionPoint injection point * @throws InjectionException if problem exist * @throws java.lang.IllegalStateException if this method gets called before the AfterBeanDiscovery event is fired. */ public void validate(InjectionPoint injectionPoint); /** * Returns true if given type is a scope type, false otherwise. * * @param annotationType annotation type * @return true if given type is a scope type, false otherwise */ public boolean isScope(Class<? extends Annotation> annotationType); /** * Returns true if given type is a normal scope type, false otherwise. * * @param annotationType annotation type * @return true if given type is a scope type, false otherwise */ public boolean isNormalScope(Class<? extends Annotation> annotationType); /** * Returns true if given type is a passivating scope type, false otherwise. * * @param annotationType annotation type * @return true if given type is a scope type, false otherwise */ public boolean isPassivatingScope(Class<? extends Annotation> annotationType); /** * Returns true if given type is a qualifier, false otherwise. * * @param annotationType annotation type * @return true if given type is a qualifier, false otherwise */ public boolean isQualifier(Class<? extends Annotation> annotationType); /** * Check whether the 2 given qualifiers are the same. * This takes {@link javax.enterprise.util.Nonbinding} into account by ignoring * those properties. * @param qualifier1 * @param qualifier2 * @return <code>true</code> if all non-nonbinding attributes are equals, <code>false</code> otherwise */ public boolean areQualifiersEquivalent(Annotation qualifier1, Annotation qualifier2); /** * @param qualifier * @return the hashCode of the Annotation. All {@link javax.enterprise.util.Nonbinding} fields get ignored */ public int getQualifierHashCode(Annotation qualifier); /** * Returns true if given type is a interceptor binding, false otherwise. * * @param annotationType annotation type * @return true if given type is a interceptor binding, false otherwise */ public boolean isInterceptorBinding(Class<? extends Annotation> annotationType); /** * Check whether the 2 given Interceptor Binding annotations are the same. * This takes {@link javax.enterprise.util.Nonbinding} into account by ignoring * those properties. * @param interceptorBinding1 * @param interceptorBinding2 * @return <code>true</code> if all non-nonbinding attributes are equals, <code>false</code> otherwise */ public boolean areInterceptorBindingsEquivalent(Annotation interceptorBinding1, Annotation interceptorBinding2); /** * @param interceptorBinding * @return the hashCode of the Annotation. All {@link javax.enterprise.util.Nonbinding} fields get ignored */ public int getInterceptorBindingHashCode(Annotation interceptorBinding); /** * Returns true if given type is a stereotype type, false otherwise. * * @param annotationType annotation type * @return true if given type is a stereotype, false otherwise */ public boolean isStereotype(Class<? extends Annotation> annotationType); /** * Returns a set of meta-annotations that are defined on the binding * * @param qualifier binding class * @return a set of meta-annotations that are defined on the binding */ public Set<Annotation> getInterceptorBindingDefinition(Class<? extends Annotation> qualifier); /** * Returns a set of meta-annotations that are defined on the stereotype type. * * @param stereotype stereotype type class * @return a set of meta-annotations that are defined on the stereotype type */ public Set<Annotation> getStereotypeDefinition(Class<? extends Annotation> stereotype); /** * Returns a context with given scope type. * * @param scope scope type class type * @return a context with given scope type */ public Context getContext(Class<? extends Annotation> scope); /** * Returns CDI container Expression Language resolver. * * @return el resolver */ public ELResolver getELResolver(); /** * Returns a {@link AnnotatedType} instance for the given * class. * * @param <T> class type * @param type class * @return a {@link AnnotatedType} instance */ public <T> AnnotatedType<T> createAnnotatedType(Class<T> type); /** * Creates a new instance of injection target Bean. * * @param <T> bean type * @param type annotated type * @return injection target */ public <T> InjectionTarget<T> createInjectionTarget(AnnotatedType<T> type); /** * Create an {@link InjectionPoint} for an annotated field. * @param field * @throws IllegalArgumentException if there is a definition error on the given field * @return injection point */ public InjectionPoint createInjectionPoint(AnnotatedField<?> field); /** * Create an {@link InjectionPoint} for an annotated parameter. * @param parameter * @throws IllegalArgumentException if there is a definition error on the given parameter * @return injection point */ public InjectionPoint createInjectionPoint(AnnotatedParameter<?> parameter); /** * @param type * @param <T> * @return the InjectionTargetFactory which is able to create {@link InjectionTarget}s for the given AnnotatedType. */ public <T> InjectionTargetFactory<T> getInjectionTargetFactory(AnnotatedType<T> type); /** * @param field * @param declaringBean * @param <X> * @return the ProducerFactory which is able to create {@link Producer}s for the given AnnotatedField. */ public <X> ProducerFactory<X> getProducerFactory(AnnotatedField<? super X> field, Bean<X> declaringBean); /** * @param method * @param declaringBean * @param <X> * @return the ProducerFactory which is able to create {@link Producer}s for the given AnnotatedMethod. */ public <X> ProducerFactory<X> getProducerFactory(AnnotatedMethod<? super X> method, Bean<X> declaringBean); /** * This method creates bean meta information from a given {@link AnnotatedType}. * The created BeanAttributes can later be used to create a {@link Bean} * via {@link #createBean(BeanAttributes, Class, InjectionTargetFactory)} or * {@link #createBean(BeanAttributes, Class, ProducerFactory)} * * @param type * @param <T> * @return the BeanAttributes created from parsing the given AnnotatedType */ public <T> BeanAttributes<T> createBeanAttributes(AnnotatedType<T> type); /** * This method creates bean meta information from a given {@link AnnotatedMember}. * The created BeanAttributes can later be used to create a {@link Bean} * via {@link #createBean(BeanAttributes, Class, InjectionTargetFactory)} or * {@link #createBean(BeanAttributes, Class, ProducerFactory)}. * * @param member * @return the BeanAttributes created from parsing the given AnnotatedType */ public BeanAttributes<?> createBeanAttributes(AnnotatedMember<?> member); /** * Create a {@link Bean} from the given bean attributes. * This version of the method uses a given {@link InjectionTargetFactory}. * @param attributes * @param beanClass * @param injectionTargetFactory * @param <T> * @return the container created Bean */ public <T> Bean<T> createBean(BeanAttributes<T> attributes, Class<T> beanClass, InjectionTargetFactory<T> injectionTargetFactory); /** * Create a {@link Bean} from the given bean attributes. * This version of the method uses a given {@link ProducerFactory}. * @param attributes * @param beanClass * @param producerFactory * @param <T> * @return the container created Bean */ public <T, X> Bean<T> createBean(BeanAttributes<T> attributes, Class<X> beanClass, ProducerFactory<X> producerFactory); /** * Resolves the Extension instance which gets used by this very BeanManager. * The given <code>extensionClass</code> must be the effective class registered * into META-INF/services and not some base class. * * @param extensionClass * @param <T> * @return the Extension instance of this very BeanManager */ public <T extends Extension> T getExtension(Class<T> extensionClass); /** * Wrapped around given expression factory and add CDI functionality. * @param expressionFactory expression factory * @return wrapped expression factory */ public ExpressionFactory wrapExpressionFactory(javax.el.ExpressionFactory expressionFactory); }
163
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java
/* * 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.enterprise.inject.spi; /** * Fired for each observer. * * @version $Rev$ $Date$ * * @param <T> observed event type * @param <X> bean class */ public interface ProcessObserverMethod<T, X> { /** * Returns annotated method. * * @return annotated method */ public AnnotatedMethod<X> getAnnotatedMethod(); /** * Returns observer method instance that * is called by the container on event. * * @return observer method instance */ public ObserverMethod<T> getObserverMethod(); /** * Add throwable. * * @param t throwable */ public void addDefinitionError(Throwable t); }
164
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/ProcessInjectionPoint.java
/* * 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.enterprise.inject.spi; /** * Gets fired for each InjectionPoint. * * @param <T> managed bean class * @param <X> declared type of the injection point */ public interface ProcessInjectionPoint<T, X> { /** * @return the InjectionPoint created from originally parsing the AnnotatedType. */ public InjectionPoint getInjectionPoint(); /** * Replace the original InjectionPoint point with the given one. * @param injectionPoint */ public void setInjectionPoint(InjectionPoint injectionPoint); /** * Adding definition error. Container aborts * processing after calling all observers. * * @param t throwable */ public void addDefinitionError(Throwable t); }
165
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/ProcessInjectionTarget.java
/* * 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.enterprise.inject.spi; /** * Fired before manged bean, session bean or Java EE * component discovery. * * @version $Rev$ $Date$ * * @param <X> class type info */ public interface ProcessInjectionTarget<X> { /** * Gets annotated type. * * @return annotated type */ public AnnotatedType<X> getAnnotatedType(); /** * Returns injection target. * * @return injection target */ public InjectionTarget<X> getInjectionTarget(); /** * Replaces injection target. * * @param injectionTarget new injection target */ public void setInjectionTarget(InjectionTarget<X> injectionTarget); /** * Adding definition error. Container aborts * processing after calling all observers. * * @param t throwable */ public void addDefinitionError(Throwable t); }
166
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/Producer.java
/* * 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.enterprise.inject.spi; import java.util.Set; import javax.enterprise.context.spi.CreationalContext; /** * Provides a generic operation for producing an instance of a type. * * @version $Rev$ $Date$ * * <T> bean type */ public interface Producer<T> { /** * Its result depends on bean type. * * <p> * * <ul> * * <li><b>Bean Class</b> : It calls the constructor annotated with {@link Initializer} if it * exists, or the constructor with no parameters otherwise.</li> * * <li><b>Producer Method or Field</b> : Calls the producer method on, * or accesses the producer field of, a contextual instance of the most * specialized bean that specializes the bean that declares the producer method</li> * * </ul> * * </p> * @param creationalContext creational context * * @return an instance of bean */ public T produce(CreationalContext<T> creationalContext); /** * Its result depends on bean type. * <p> * <ul> * <li><b>Bean Class</b> : Does nothing.</li> * <li><b>Producer Method</b> : Calls disposer method or any other cleanup. * </ul> * </p> * * @param instance dispose istance */ public void dispose(T instance); /** * Its result depends on bean type. * * <p> * * <ul> * <li><b>Bean Class</b> : Returns the set of InjectionPoint objects representing all injected fields, * bean constructor parameters and initializer method parameters.</li> * * <li><b>Producer Method</b> : Returns the set of InjectionPoint objects * representing all parameters of the producer method.</li> * * </ul> * * </p> * * @return set of injection points */ public Set<InjectionPoint> getInjectionPoints(); }
167
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/ProcessProducerMethod.java
/* * 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.enterprise.inject.spi; /** * Fired before registering producer method. * * @version $Rev$ $Date$ * * @param <X> bean class * @param <T> producer return type */ public interface ProcessProducerMethod<X, T> extends ProcessBean<T> { /** * Returns annotated method. * * @return annotated method */ public AnnotatedMethod<X> getAnnotatedProducerMethod(); /** * Returns annotated parameter. * @return the {@link javax.enterprise.inject.Disposes} annotated parameter of the disposal method * which fits the producer field, or <code>null</code> if there is no disposal method. */ public AnnotatedParameter<X> getAnnotatedDisposedParameter(); }
168
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/ProcessSessionBean.java
/* * 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.enterprise.inject.spi; /** * Fires event before registering session bean. * * @version $Rev$ $Date$ * * @param <X> bean class */ public interface ProcessSessionBean<X> extends ProcessManagedBean<Object> { /** * Returns ejb name. * * @return ejb name */ public String getEjbName(); /** * Returns ejb type. * * @return ejb type. */ public SessionBeanType getSessionBeanType(); }
169
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java
/* * 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.enterprise.inject.spi; import java.lang.annotation.Annotation; /** * Container fires this event before discovery * of the beans process. * * @version $Rev$ $Date$ * */ public interface BeforeBeanDiscovery { /** * Declares a new qualifier. * * @param qualifier qualifier */ public void addQualifier(Class<? extends Annotation> qualifier); /** * Declare a new qualifier via the information from the given AnnotatedType. * @param qualifier */ public void addQualifier(AnnotatedType<? extends Annotation> qualifier); /** * Declares a new scope. * * @param scope scope * @param normal is normal or not * @param passivating passivated or not */ public void addScope(Class<? extends Annotation> scope, boolean normal, boolean passivating); /** * Declares a new stereotype. * * @param stereotype stereotype class * @param stereotypeDef meta annotations */ public void addStereotype(Class<? extends Annotation> stereotype, Annotation... stereotypeDef); /** * Declares a new interceptor binding. * * @param binding binding class * @param bindingDef meta annotations */ public void addInterceptorBinding(Class<? extends Annotation> binding, Annotation... bindingDef); /** * Declare a new interceptor binding via the information from the given AnnotatedType. * @param bindingType */ public void addInterceptorBinding(AnnotatedType<? extends Annotation> bindingType); /** * Adds new annotated type. * This version shall be used when adding AnnotatedTypes for classes which are * not yet scanned by the CDI container. * * @param type annotated type */ public void addAnnotatedType(AnnotatedType<?> type); /** * Adds new annotated type for classes which are not picked up by the CDI container * or if you like to add multiple AnnotatedType for the same class. * * @param type annotated type * @param id to distinguish AnnotatedTypes for the same class. */ public void addAnnotatedType(AnnotatedType<?> type, String id); }
170
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/AnnotatedField.java
/* * 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.enterprise.inject.spi; import java.lang.reflect.Field; /** * Defines field member contract. * * @version $Rev$ $Date$ * * @param <X> declaring type */ public interface AnnotatedField<X> extends AnnotatedMember<X> { /** * {@inheritDoc} */ public Field getJavaMember(); }
171
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/Bean.java
/* * 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.enterprise.inject.spi; import java.util.Set; import javax.enterprise.context.spi.Contextual; /** * Reprensts bean instances that are contextual * and injectable by the container. * * @version $Rev$ $Date$ * * @param <T> bean representation type */ public interface Bean<T> extends Contextual<T>, BeanAttributes<T> { /** * Returns all injection points of this bean. * * @return injection points */ public abstract Set<InjectionPoint> getInjectionPoints(); /** * Returns class of bean. * * @return class of bean that it represents */ public abstract Class<?> getBeanClass(); /** * If bean is nullable return true, false * otherwise. * * <p> * Nullable means that if producer * bean api type is primitive, its nullable property * will be false. * </p> * * @return true if bean is nullable. * @deprecated since CDI-1.1. This should be ignored by the container from now on. */ public abstract boolean isNullable(); }
172
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/AfterDeploymentValidation.java
/* * 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.enterprise.inject.spi; /** * Event that is fired after container * validates all injection points are valid. * * @version $Rev$ $Date$ * */ public interface AfterDeploymentValidation { /** * Add deployment problem that causes * container aborts processing after validation. * * @param t throwable */ public void addDeploymentProblem(Throwable t); }
173
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/ProcessManagedBean.java
/* * 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.enterprise.inject.spi; /** * Fired before registering managed bean. * * @version $Rev$ $Date$ * * @param <X> bean class */ public interface ProcessManagedBean<X> extends ProcessBean<X> { /** * Returns annotated type. * * @return annotated type */ public AnnotatedType<X> getAnnotatedBeanClass(); }
174
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/CDIProvider.java
/* * 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.enterprise.inject.spi; /** * <p>Pluggable mechanism to resolve the CDI instance.</p> * <p>A container or an application can set this with * {@link CDI#setCDIProvider(CDIProvider)}</p> * * @since 1.1 */ public interface CDIProvider { public CDI<Object> getCDI(); }
175
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/DefinitionException.java
/* * 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.enterprise.inject.spi; /** * A DefinitionException occurs when a single bean violates the CDI rules. * This Exception will only get thrown at container startup. * * @see DeploymentException */ public class DefinitionException extends RuntimeException { private static final long serialVersionUID = 1L; public DefinitionException() { } public DefinitionException(Throwable cause) { super(cause); } public DefinitionException(String message) { super(message); } public DefinitionException(String message, Throwable cause) { super(message, cause); } }
176
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/inject/spi/ProcessSyntheticAnnotatedType.java
/* * 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.enterprise.inject.spi; /** * This event gets fired for AnnotatedTypes which are not a result * of the scanning process but got manually added. */ public interface ProcessSyntheticAnnotatedType<X> extends ProcessAnnotatedType<X> { /** * @return the Extension which added this AnnotatedType */ public Extension getSource(); }
177
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/event/TransactionPhase.java
/* * 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.enterprise.event; /** * Transactional observer phases. * * <p> * Observers are notified on transaction phases. * </p> * * @version $Rev$ $Date$ * */ public enum TransactionPhase { /**Means in trnasaction*/ IN_PROGRESS, /**Before completion phase*/ BEFORE_COMPLETION, /**After completion phase*/ AFTER_COMPLETION, /**After failure phase*/ AFTER_FAILURE, /**After success phase*/ AFTER_SUCCESS }
178
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/event/ObserverException.java
/* * 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.enterprise.event; /** * Exception related with observers. * * @version $Rev$ $Date$ */ public class ObserverException extends RuntimeException { private static final long serialVersionUID = -801836224808304381L; /** * Creates new exception. */ public ObserverException() { } /** * Creates new exception with message. * * @param message exception message */ public ObserverException(String message) { super(message); } /** * Creates new exception with cause. * * @param cause exception cause */ public ObserverException(Throwable cause) { super(cause); } /** * Creates new exception with given message and cause. * * @param message exception message * @param cause exception cause */ public ObserverException(String message, Throwable cause) { super(message, cause); } }
179
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/event/Reception.java
/* * 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.enterprise.event; /** * Notify enums. * * @version $Rev$ $Date$ * */ public enum Reception { /**Notify observer if owner bean exist*/ IF_EXISTS, /**Always notify observer*/ ALWAYS }
180
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/event/Event.java
/* * 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.enterprise.event; import java.lang.annotation.Annotation; import javax.enterprise.util.TypeLiteral; /** * The event interface is used for firing events with specific classifiers and types. * * A built-in event bean is provided by the container. * * @param <T> the event type */ public interface Event<T> { public void fire(T event); public Event<T> select(Annotation... qualifiers); public <U extends T> Event<U> select(Class<U> subtype, Annotation... qualifiers); public <U extends T> Event<U> select(TypeLiteral<U> subtype, Annotation... qualifiers); }
181
0
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise
Create_ds/geronimo-specs/geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/event/Observes.java
/* * 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.enterprise.event; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; /** * <p>Specifies that a method is an observer method and which event should be observed.</p> * Sample: * <pre> * public class UserHandler * { * public void afterUserLogin(@Observes UserLoginEvent userHasLoggedIn) * { * ... * } * } * </pre> * @version $Rev$ $Date$ * @see javax.enterprise.inject.spi.ObserverMethod */ @Target(PARAMETER) @Retention(RUNTIME) @Documented public @interface Observes { /**Specifies whether or not call observer according to owner bean instace*/ public Reception notifyObserver() default Reception.ALWAYS; /**Transaction phase*/ public TransactionPhase during() default TransactionPhase.IN_PROGRESS; }
182
0
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax/persistence/PersistenceContexts.java
/* * 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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence; import java.lang.annotation.Target; import java.lang.annotation.Retention; import java.lang.annotation.ElementType; import java.lang.annotation.RetentionPolicy; /** * @version $Rev$ $Date$ */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface PersistenceContexts { PersistenceContext[] value(); }
183
0
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax/persistence/Basic.java
/* * 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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence; import java.lang.annotation.Target; import java.lang.annotation.Retention; import java.lang.annotation.ElementType; import java.lang.annotation.RetentionPolicy; /** * @version $Rev$ $Date$ */ @Target({ElementType.METHOD, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface Basic { FetchType fetch() default FetchType.EAGER; boolean optional() default true; }
184
0
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax/persistence/Persistence.java
/* * 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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.util.Collections; import java.util.Enumeration; import java.util.Map; import java.util.HashSet; import java.util.Set; import javax.persistence.spi.PersistenceProvider; /** * @version $Rev$ $Date$ */ /** * Bootstrap class that is used to obtain {@link javax.persistence.EntityManagerFactory} * references. */ public class Persistence { protected static final Set<PersistenceProvider> providers = new HashSet<PersistenceProvider>(); // Changed to the hard coded PERSISTENCE_PROVIDER value to pass signature tests. // public static final java.lang.String PERSISTENCE_PROVIDER = PersistenceProvider.class.getName(); public static final java.lang.String PERSISTENCE_PROVIDER = "javax.persistence.spi.PeristenceProvider"; static final String PERSISTENCE_PROVIDER_PROPERTY = "javax.persistence.provider"; static final String PERSISTENCE_PROVIDER_SERVICE = "META-INF/services/" + PersistenceProvider.class.getName(); /** * Create and return an EntityManagerFactory for the named persistence unit. * * @param persistenceUnitName The name of the persistence unit * @return The factory that creates EntityManagers configured according to the * specified persistence unit */ public static EntityManagerFactory createEntityManagerFactory( String persistenceUnitName) { return createEntityManagerFactory(persistenceUnitName, Collections.EMPTY_MAP); } /** * Create and return an EntityManagerFactory for the named persistence unit using the * given properties. * * @param persistenceUnitName The name of the persistence unit * @param properties Additional properties to use when creating the factory. The values of * these properties override any values that may have been configured * elsewhere. * @return The factory that creates EntityManagers configured according to the * specified persistence unit. */ public static EntityManagerFactory createEntityManagerFactory( String persistenceUnitName, Map properties) { if (properties == null) { properties = Collections.EMPTY_MAP; } // start by loading a provider explicitly specified in properties. The spec // doesn't seem to forbid providers that are not deployed as a service Object providerName = properties.get(PERSISTENCE_PROVIDER_PROPERTY); if (providerName instanceof String) { EntityManagerFactory factory = createFactory( providerName.toString(), persistenceUnitName, properties); if (factory != null) { return factory; } } // load correctly deployed providers ClassLoader loader = Thread.currentThread().getContextClassLoader(); try { Enumeration<URL> providers = loader .getResources(PERSISTENCE_PROVIDER_SERVICE); while (providers.hasMoreElements()) { String name = getProviderName(providers.nextElement()); if (name != null) { EntityManagerFactory factory = createFactory( name, persistenceUnitName, properties); if (factory != null) { return factory; } } } } catch (IOException e) { // spec doesn't mention any exceptions thrown by this method } return null; } static String getProviderName(URL url) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader( url.openStream(), "UTF-8")); String providerName; try { providerName = in.readLine(); } finally { in.close(); } if (providerName != null) { providerName = providerName.trim(); } return providerName; } static EntityManagerFactory createFactory( String providerName, String persistenceUnitName, Map properties) throws PersistenceException { Class providerClass; try { providerClass = Class.forName(providerName, true, Thread .currentThread().getContextClassLoader()); } catch (Exception e) { throw new PersistenceException( "Invalid or inaccessible provider class: " + providerName, e); } try { PersistenceProvider provider = (PersistenceProvider) providerClass .newInstance(); return provider.createEntityManagerFactory(persistenceUnitName, properties); } catch (Exception e) { throw new PersistenceException("Provider error. Provider: " + providerName, e); } } }
185
0
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax/persistence/Temporal.java
/* * 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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence; import java.lang.annotation.Target; import java.lang.annotation.Retention; import java.lang.annotation.ElementType; import java.lang.annotation.RetentionPolicy; /** * @version $Rev$ $Date$ */ @Target({ElementType.METHOD, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface Temporal { TemporalType value(); }
186
0
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax/persistence/OneToMany.java
/* * 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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence; import java.lang.annotation.Target; import java.lang.annotation.Retention; import java.lang.annotation.ElementType; import java.lang.annotation.RetentionPolicy; /** * @version $Rev$ $Date$ */ @Target({ElementType.METHOD, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface OneToMany { Class targetEntity() default void.class; CascadeType[] cascade() default {}; FetchType fetch() default FetchType.LAZY; String mappedBy() default ""; }
187
0
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax/persistence/Lob.java
/* * 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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence; import java.lang.annotation.Target; import java.lang.annotation.Retention; import java.lang.annotation.ElementType; import java.lang.annotation.RetentionPolicy; /** * @version $Rev$ $Date$ */ @Target({ElementType.METHOD, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface Lob { }
188
0
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax/persistence/PersistenceContextType.java
/* * 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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence; /** * @version $Rev$ $Date$ */ public enum PersistenceContextType { TRANSACTION, EXTENDED }
189
0
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax/persistence/EntityExistsException.java
/* * 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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence; /** * @version $Revision$ $Date$ */ public class EntityExistsException extends PersistenceException { public EntityExistsException() { } public EntityExistsException(String message) { super(message); } public EntityExistsException(Throwable cause) { super(cause); } public EntityExistsException(String message, Throwable cause) { super(message, cause); } }
190
0
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax/persistence/PersistenceContext.java
/* * 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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence; import java.lang.annotation.Target; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * @version $Rev$ $Date$ */ @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface PersistenceContext { String name() default ""; String unitName() default ""; PersistenceContextType type() default PersistenceContextType.TRANSACTION; PersistenceProperty[] properties() default {}; }
191
0
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax/persistence/OrderBy.java
/* * 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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence; import java.lang.annotation.Target; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.ElementType; /** * @version $Rev$ $Date$ */ @Target({ElementType.METHOD, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface OrderBy { String value() default ""; }
192
0
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax/persistence/PostRemove.java
/* * 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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence; import java.lang.annotation.Target; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * @version $Rev$ $Date$ */ @Target( { ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) public @interface PostRemove { }
193
0
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax/persistence/IdClass.java
/* * 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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence; import java.lang.annotation.Target; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.ElementType; /** * @version $Rev$ $Date$ */ @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface IdClass { Class value(); }
194
0
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax/persistence/RollbackException.java
/* * 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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence; public class RollbackException extends PersistenceException { public RollbackException() { } public RollbackException(String string) { super(string); } public RollbackException(String string, Throwable throwable) { super(string, throwable); } public RollbackException(Throwable throwable) { super(throwable); } }
195
0
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax/persistence/PrimaryKeyJoinColumns.java
/* * 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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence; import java.lang.annotation.Target; import java.lang.annotation.Retention; import java.lang.annotation.ElementType; import java.lang.annotation.RetentionPolicy; /** * @version $Rev$ $Date$ */ @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface PrimaryKeyJoinColumns { PrimaryKeyJoinColumn[] value(); }
196
0
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax/persistence/DiscriminatorColumn.java
/* * 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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence; import java.lang.annotation.Target; import java.lang.annotation.Retention; import java.lang.annotation.ElementType; import java.lang.annotation.RetentionPolicy; /** * @version $Rev$ $Date$ */ @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface DiscriminatorColumn { String name() default "DTYPE"; DiscriminatorType discriminatorType() default DiscriminatorType.STRING; String columnDefinition() default ""; int length() default 31; }
197
0
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax/persistence/Id.java
/* * 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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence; import java.lang.annotation.Target; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.ElementType; @Target( { ElementType.METHOD, ElementType.FIELD }) @Retention(RetentionPolicy.RUNTIME) public @interface Id { }
198
0
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax
Create_ds/geronimo-specs/geronimo-jpa_1.0_spec/src/main/java/javax/persistence/NamedQuery.java
/* * 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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence; import java.lang.annotation.Target; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * @version $Rev$ $Date$ */ @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface NamedQuery { String name(); String query(); QueryHint[] hints() default {}; }
199