Author: remy.maucherat(a)jboss.com
Date: 2009-10-28 20:54:53 -0400 (Wed, 28 Oct 2009)
New Revision: 1228
Added:
trunk/java/javax/annotation/ManagedBean.java
trunk/java/javax/annotation/Named.java
trunk/java/javax/annotation/NonBinding.java
trunk/java/javax/annotation/Stereotype.java
trunk/java/javax/annotation/package.html
trunk/java/javax/annotation/security/package.html
trunk/java/javax/annotation/sql/
trunk/java/javax/annotation/sql/DataSourceDefinition.java
trunk/java/javax/annotation/sql/DataSourceDefinitions.java
Modified:
trunk/build.xml
trunk/java/javax/annotation/Generated.java
trunk/java/javax/annotation/PostConstruct.java
trunk/java/javax/annotation/PreDestroy.java
trunk/java/javax/annotation/Resource.java
trunk/java/javax/annotation/Resources.java
trunk/java/javax/annotation/security/DeclareRoles.java
trunk/java/javax/annotation/security/DenyAll.java
trunk/java/javax/annotation/security/PermitAll.java
trunk/java/javax/annotation/security/RolesAllowed.java
trunk/java/javax/annotation/security/RunAs.java
Log:
- Update common annotations (from the RI for now, as with the rest of the API).
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2009-10-28 15:08:23 UTC (rev 1227)
+++ trunk/build.xml 2009-10-29 00:54:53 UTC (rev 1228)
@@ -127,11 +127,10 @@
<target name="package" >
- <!-- Common Annotations 1.0 JAR File -->
+ <!-- Common Annotations 1.1 JAR File -->
<jar jarfile="${annotations-api.jar}">
<fileset dir="${tomcat.classes}">
- <include name="javax/annotation/*" />
- <include name="javax/annotation/security/*" />
+ <include name="javax/annotation/**" />
<include name="javax/ejb/*" />
<include name="javax/persistence/*" />
<include name="javax/xml/ws/*" />
@@ -141,7 +140,7 @@
</fileset>
</jar>
- <!-- Servlet 2.5 Implementation JAR File -->
+ <!-- Servlet 3.0 Implementation JAR File -->
<jar jarfile="${servlet-api.jar}">
<fileset dir="${tomcat.classes}">
<include name="javax/servlet/*" />
@@ -155,7 +154,7 @@
</fileset>
</jar>
- <!-- JSP 2.1 Implementation JAR File -->
+ <!-- JSP 2.2 Implementation JAR File -->
<jar jarfile="${jsp-api.jar}">
<fileset dir="${tomcat.classes}">
<include name="javax/servlet/jsp/**" />
@@ -165,7 +164,7 @@
</fileset>
</jar>
- <!-- JSP 2.1 EL Implementation JAR File -->
+ <!-- JSP 2.2 EL Implementation JAR File -->
<jar jarfile="${el-api.jar}">
<fileset dir="${tomcat.classes}">
<include name="javax/el/*" />
Modified: trunk/java/javax/annotation/Generated.java
===================================================================
--- trunk/java/javax/annotation/Generated.java 2009-10-28 15:08:23 UTC (rev 1227)
+++ trunk/java/javax/annotation/Generated.java 2009-10-29 00:54:53 UTC (rev 1228)
@@ -1,35 +1,73 @@
/*
- * 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
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the "License"). You may not use this file except
+ * in compliance with the License.
*
- *
http://www.apache.org/licenses/LICENSE-2.0
+ * You can obtain a copy of the license at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt or
+ *
https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
*
- * 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.
+ * When distributing Covered Code, include this CDDL
+ * HEADER in each file and include the License file at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
+ * add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your
+ * own identifying information: Portions Copyright [yyyy]
+ * [name of copyright owner]
*/
+/*
+ *
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
package javax.annotation;
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+/**
+ * The Generated annoation is used to mark source code that has been generated.
+ * It can also be used to differentiate user written code from generated code
+ * in a single file. When used, the value element must have the name of the
+ * code generator. The recommended convention is to use the fully qualified
+ * name of the code generator in the value field .
+ * For example: com.company.package.classname.
+ * The date element is used to indicate the date the source was generated.
+ * The date element must follow the ISO 8601 standard. For example the date
+ * element would have the following value 2001-07-04T12:08:56.235-0700
+ * which represents 2001-07-04 12:08:56 local time in the U.S. Pacific
+ * Time time zone.
+ * The comment element is a place holder for any comments that the code
+ * generator may want to include in the generated code.
+ *
+ * @since Common Annotations 1.0
+ */
-(a)Target({ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR,
- ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.METHOD,
- ElementType.PACKAGE, ElementType.PARAMETER, ElementType.TYPE})
-(a)Retention(RetentionPolicy.SOURCE)
+@Documented
+@Retention(SOURCE)
+@Target({PACKAGE, TYPE, ANNOTATION_TYPE, METHOD, CONSTRUCTOR, FIELD,
+ LOCAL_VARIABLE, PARAMETER})
+public @interface Generated {
+ /**
+ * This is used by the code generator to mark the generated classes
+ * and methods.
+ */
+ String[] value();
-public @interface Generated {
- public String[] value();
- public String date() default "";
- public String comment() default "";
+ /**
+ * Date when the source was generated.
+ */
+ String date() default "";
+
+ /**
+ * A place holder for any comments that the code generator may want to
+ * include in the generated code.
+ */
+ String comments() default "";
}
+
Added: trunk/java/javax/annotation/ManagedBean.java
===================================================================
--- trunk/java/javax/annotation/ManagedBean.java (rev 0)
+++ trunk/java/javax/annotation/ManagedBean.java 2009-10-29 00:54:53 UTC (rev 1228)
@@ -0,0 +1,56 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the "License"). You may not use this file except
+ * in compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt or
+ *
https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * HEADER in each file and include the License file at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
+ * add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your
+ * own identifying information: Portions Copyright [yyyy]
+ * [name of copyright owner]
+ */
+
+/*
+ *
+ * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
+package javax.annotation;
+
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * The ManagedBean annotation marks a POJO (Plain Old Java Object) as a
+ * ManagedBean.A ManagedBean supports a small set of basic services such as
+ * resource injection, lifecycle callbacks and interceptors.
+ *
+ * @since Common Annotations 1.1
+ */
+@Target(TYPE)
+@Retention(RUNTIME)
+public @interface ManagedBean {
+ /**
+ * The name of the Managed Bean. Managed Bean names must be unique within a
+ * Java EE module. For each named Managed Bean, Java EE containers must make
+ * available the following entries in JNDI, using the same naming scheme used
+ * for EJB components.
+ * <p>
+ * In the application namespace: <p>
+ * java:app/<module-name>/<bean-name> <p>
+ * In the module namespace of the module containing the Managed Bean:
+ * <p> java:module/<bean-name>
+ *
+ */
+ public String value() default "";
+}
Added: trunk/java/javax/annotation/Named.java
===================================================================
--- trunk/java/javax/annotation/Named.java (rev 0)
+++ trunk/java/javax/annotation/Named.java 2009-10-29 00:54:53 UTC (rev 1228)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.annotation;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Specifies the name of a bean.
+ *
+ * @author Gavin King
+ * @author Pete Muir
+ */
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@Documented
+public @interface Named
+{
+
+ /**
+ * If no name is explicitly specified, the default name is used.
+ *
+ * For simple beans and session beans the default name is the unqualified
+ * class name of the bean class, after converting the first character to
+ * lower case.
+ *
+ * For producer methods the default name is the method name, unless the
+ * method follows the JavaBeans property getter naming convention, in which
+ * case the default name is the JavaBeans property name.
+ *
+ * @return the bean name
+ */
+ public String value() default "";
+
+}
Added: trunk/java/javax/annotation/NonBinding.java
===================================================================
--- trunk/java/javax/annotation/NonBinding.java (rev 0)
+++ trunk/java/javax/annotation/NonBinding.java 2009-10-29 00:54:53 UTC (rev 1228)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.annotation;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Specifies that a member of a binding type or interceptor binding type is to
+ * be ignored for the purposes of resolution.
+ *
+ * @author Gavin King
+ *
+ */
+@Retention(RUNTIME)
+@Target(METHOD)
+public @interface NonBinding
+{
+}
Modified: trunk/java/javax/annotation/PostConstruct.java
===================================================================
--- trunk/java/javax/annotation/PostConstruct.java 2009-10-28 15:08:23 UTC (rev 1227)
+++ trunk/java/javax/annotation/PostConstruct.java 2009-10-29 00:54:53 UTC (rev 1228)
@@ -1,30 +1,64 @@
/*
- * 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
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the "License"). You may not use this file except
+ * in compliance with the License.
*
- *
http://www.apache.org/licenses/LICENSE-2.0
+ * You can obtain a copy of the license at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt or
+ *
https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
*
- * 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.
+ * When distributing Covered Code, include this CDDL
+ * HEADER in each file and include the License file at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
+ * add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your
+ * own identifying information: Portions Copyright [yyyy]
+ * [name of copyright owner]
*/
+/*
+ *
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
package javax.annotation;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
-(a)Target({ElementType.METHOD})
-(a)Retention(RetentionPolicy.RUNTIME)
-
+/**
+ * The PostConstruct annotation is used on a method that needs to be executed
+ * after dependency injection is done to perform any initialization. This
+ * method MUST be invoked before the class is put into service. This
+ * annotation MUST be supported on all classes that support dependency
+ * injection. The method annotated with PostConstruct MUST be invoked even
+ * if the class does not request any resources to be injected. Only one
+ * method can be annotated with this annotation. The method on which the
+ * PostConstruct annotation is applied MUST fulfill all of the following
+ * criteria -
+- The method MUST NOT have any parameters except in the case of EJB
+ * interceptors in which case it takes an InvocationC ontext object as
+ * defined by the EJB specification.
+ * - The return type of the method MUST be void.
+ * - The method MUST NOT throw a checked exception.
+ * - The method on which PostConstruct is applied MAY be public, protected,
+ * package private or private.
+ * - The method MUST NOT be static except for the application client.
+ * - The method MAY be final.
+ * - If the method throws an unchecked exception the class MUST NOT be put into
+ * service except in the case of EJBs where the EJB can handle exceptions and
+ * even recover from them.
+ * @since Common Annotations 1.0
+ * @see javax.annotation.PreDestroy
+ * @see javax.annotation.Resource
+ */
+@Documented
+@Retention (RUNTIME)
+@Target(METHOD)
public @interface PostConstruct {
}
Modified: trunk/java/javax/annotation/PreDestroy.java
===================================================================
--- trunk/java/javax/annotation/PreDestroy.java 2009-10-28 15:08:23 UTC (rev 1227)
+++ trunk/java/javax/annotation/PreDestroy.java 2009-10-29 00:54:53 UTC (rev 1228)
@@ -1,30 +1,64 @@
/*
- * 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
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the "License"). You may not use this file except
+ * in compliance with the License.
*
- *
http://www.apache.org/licenses/LICENSE-2.0
+ * You can obtain a copy of the license at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt or
+ *
https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
*
- * 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.
+ * When distributing Covered Code, include this CDDL
+ * HEADER in each file and include the License file at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
+ * add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your
+ * own identifying information: Portions Copyright [yyyy]
+ * [name of copyright owner]
*/
+/*
+ *
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
package javax.annotation;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
-(a)Target({ElementType.METHOD})
-(a)Retention(RetentionPolicy.RUNTIME)
+/**
+ * The PreDestroy annotation is used on methods as a callback notification to
+ * signal that the instance is in the process of being removed by the
+ * container. The method annotated with PreDestroy is typically used to
+ * release resources that it has been holding. This annotation MUST be
+ * supported by all container managed objects that support PostConstruct
+ * except the application client container in Java EE 5. The method on which
+ * the PreDestroy annotation is applied MUST fulfill all of the following
+ * criteria -
+ * - The method MUST NOT have any parameters except in the case of EJB
+ * interceptors in which case it takes an InvocationContext object as defined
+ * by the EJB specification.
+ * - The return type of the method MUST be void.
+ * - The method MUST NOT throw a checked exception.
+ * - The method on which PreDestroy is applied MAY be public, protected,
+ * package private or private.
+ * - The method MUST NOT be static.
+ * - The method MAY be final.
+ * - If the method throws an unchecked exception it is ignored except in the
+ * case of EJBs where the EJB can handle exceptions.
+ *
+ * @see javax.annotation.PostConstruct
+ * @see javax.annotation.Resource
+ * @since Common Annotations 1.0
+ */
+@Documented
+@Retention (RUNTIME)
+@Target(METHOD)
public @interface PreDestroy {
}
Modified: trunk/java/javax/annotation/Resource.java
===================================================================
--- trunk/java/javax/annotation/Resource.java 2009-10-28 15:08:23 UTC (rev 1227)
+++ trunk/java/javax/annotation/Resource.java 2009-10-29 00:54:53 UTC (rev 1228)
@@ -1,40 +1,132 @@
/*
- * 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
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the "License"). You may not use this file except
+ * in compliance with the License.
*
- *
http://www.apache.org/licenses/LICENSE-2.0
+ * You can obtain a copy of the license at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt or
+ *
https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
*
- * 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.
+ * When distributing Covered Code, include this CDDL
+ * HEADER in each file and include the License file at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
+ * add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your
+ * own identifying information: Portions Copyright [yyyy]
+ * [name of copyright owner]
*/
+/*
+ *
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
package javax.annotation;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
-(a)Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
-(a)Retention(RetentionPolicy.RUNTIME)
+/**
+ * The Resource annotation marks a resource that is needed
+ * by the application. This annotation may be applied to an
+ * application component class, or to fields or methods of the
+ * component class. When the annotation is applied to a
+ * field or method, the container will inject an instance
+ * of the requested resource into the application component
+ * when the component is initialized. If the annotation is
+ * applied to the component class, the annotation declares a
+ * resource that the application will look up at runtime. <p>
+ *
+ * Even though this annotation is not marked Inherited, deployment
+ * tools are required to examine all superclasses of any component
+ * class to discover all uses of this annotation in all superclasses.
+ * All such annotation instances specify resources that are needed
+ * by the application component. Note that this annotation may
+ * appear on private fields and methods of superclasses; the container
+ * is required to perform injection in these cases as well.
+ *
+ * @since Common Annotations 1.0
+ */
+@Target({TYPE, FIELD, METHOD})
+@Retention(RUNTIME)
+public @interface Resource {
+ /**
+ * The JNDI name of the resource. For field annotations,
+ * the default is the field name. For method annotations,
+ * the default is the JavaBeans property name corresponding
+ * to the method. For class annotations, there is no default
+ * and this must be specified.
+ */
+ String name() default "";
-public @interface Resource {
- public enum AuthenticationType {
- CONTAINER,
- APPLICATION
+ /**
+ * The name of the resource that the reference points to. It can
+ * link to any compatible resource using the global JNDI names.
+ */
+
+ String lookup() default "";
+
+ /**
+ * The Java type of the resource. For field annotations,
+ * the default is the type of the field. For method annotations,
+ * the default is the type of the JavaBeans property.
+ * For class annotations, there is no default and this must be
+ * specified.
+ */
+ Class type() default java.lang.Object.class;
+
+ /**
+ * The two possible authentication types for a resource.
+ */
+ enum AuthenticationType {
+ CONTAINER,
+ APPLICATION
}
- public String name() default "";
- public Class type() default Object.class;
- public AuthenticationType authenticationType() default AuthenticationType.CONTAINER;
- public boolean shareable() default true;
- public String description() default "";
- public String mappedName() default "";
+
+ /**
+ * The authentication type to use for this resource.
+ * This may be specified for resources representing a
+ * connection factory of any supported type, and must
+ * not be specified for resources of other types.
+ */
+ AuthenticationType authenticationType() default AuthenticationType.CONTAINER;
+
+ /**
+ * Indicates whether this resource can be shared between
+ * this component and other components.
+ * This may be specified for resources representing a
+ * connection factory of any supported type, and must
+ * not be specified for resources of other types.
+ */
+ boolean shareable() default true;
+
+ /**
+ * A product specific name that this resource should be mapped to.
+ * The name of this resource, as defined by the <code>name</code>
+ * element or defaulted, is a name that is local to the application
+ * component using the resource. (It's a name in the JNDI
+ * <code>java:comp/env</code> namespace.) Many application servers
+ * provide a way to map these local names to names of resources
+ * known to the application server. This mapped name is often a
+ * <i>global</i> JNDI name, but may be a name of any form. <p>
+ *
+ * Application servers are not required to support any particular
+ * form or type of mapped name, nor the ability to use mapped names.
+ * The mapped name is product-dependent and often installation-dependent.
+ * No use of a mapped name is portable.
+ */
+ String mappedName() default "";
+
+ /**
+ * Description of this resource. The description is expected
+ * to be in the default language of the system on which the
+ * application is deployed. The description can be presented
+ * to the Deployer to help in choosing the correct resource.
+ */
+ String description() default "";
}
Modified: trunk/java/javax/annotation/Resources.java
===================================================================
--- trunk/java/javax/annotation/Resources.java 2009-10-28 15:08:23 UTC (rev 1227)
+++ trunk/java/javax/annotation/Resources.java 2009-10-29 00:54:53 UTC (rev 1228)
@@ -1,31 +1,48 @@
/*
- * 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
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the "License"). You may not use this file except
+ * in compliance with the License.
*
- *
http://www.apache.org/licenses/LICENSE-2.0
+ * You can obtain a copy of the license at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt or
+ *
https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
*
- * 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.
+ * When distributing Covered Code, include this CDDL
+ * HEADER in each file and include the License file at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
+ * add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your
+ * own identifying information: Portions Copyright [yyyy]
+ * [name of copyright owner]
*/
+/*
+ *
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
package javax.annotation;
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+/**
+ * This class is used to allow multiple resources declarations.
+ *
+ * @see javax.annotation.Resource
+ * @since Common Annotations 1.0
+ */
-(a)Target({ElementType.TYPE})
-(a)Retention(RetentionPolicy.RUNTIME)
-
+@Documented
+@Retention(RUNTIME)
+@Target(TYPE)
public @interface Resources {
- public Resource[] value();
+ /**
+ * Array used for multiple resource declarations.
+ */
+ Resource[] value();
}
Added: trunk/java/javax/annotation/Stereotype.java
===================================================================
--- trunk/java/javax/annotation/Stereotype.java (rev 0)
+++ trunk/java/javax/annotation/Stereotype.java 2009-10-29 00:54:53 UTC (rev 1228)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed 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.annotation;
+
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Annotation;
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Specifies that an annotation type is a stereotype.
+ *
+ * @author Pete Muir
+ * @author Gavin King
+ */
+
+@Retention(RUNTIME)
+@Target(ANNOTATION_TYPE)
+@Documented
+public @interface Stereotype
+{
+
+ /**
+ * Restrict the scope of the stereotyped bean
+ *
+ * @return the allowed scopes
+ */
+ public Class<? extends Annotation>[] supportedScopes() default {};
+
+ /**
+ * Require that stereotype beans have certain API types
+ *
+ * @return the required types
+ */
+ public Class<?>[] requiredTypes() default {};
+
+}
Added: trunk/java/javax/annotation/package.html
===================================================================
--- trunk/java/javax/annotation/package.html (rev 0)
+++ trunk/java/javax/annotation/package.html 2009-10-29 00:54:53 UTC (rev 1228)
@@ -0,0 +1,29 @@
+<!--
+
+ The contents of this file are subject to the terms
+ of the Common Development and Distribution License
+ (the "License"). You may not use this file except
+ in compliance with the License.
+
+ You can obtain a copy of the license at
+ glassfish/bootstrap/legal/CDDLv1.0.txt or
+
https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ See the License for the specific language governing
+ permissions and limitations under the License.
+
+ When distributing Covered Code, include this CDDL
+ HEADER in each file and include the License file at
+ glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
+ add the following below this CDDL HEADER, with the
+ fields enclosed by brackets "[]" replaced with your
+ own identifying information: Portions Copyright [yyyy]
+ [name of copyright owner]
+
+ Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+-->
+
+<html>
+<body>
+ This package defines the common annotations.
+</body>
+</html>
Modified: trunk/java/javax/annotation/security/DeclareRoles.java
===================================================================
--- trunk/java/javax/annotation/security/DeclareRoles.java 2009-10-28 15:08:23 UTC (rev
1227)
+++ trunk/java/javax/annotation/security/DeclareRoles.java 2009-10-29 00:54:53 UTC (rev
1228)
@@ -1,31 +1,44 @@
/*
- * 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
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the "License"). You may not use this file except
+ * in compliance with the License.
*
- *
http://www.apache.org/licenses/LICENSE-2.0
+ * You can obtain a copy of the license at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt or
+ *
https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
*
- * 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.
+ * When distributing Covered Code, include this CDDL
+ * HEADER in each file and include the License file at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
+ * add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your
+ * own identifying information: Portions Copyright [yyyy]
+ * [name of copyright owner]
*/
+/*
+ *
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
package javax.annotation.security;
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-(a)Target({ElementType.TYPE})
-(a)Retention(RetentionPolicy.RUNTIME)
-
+/**
+ * Used by application to declare roles. It can be
+ * specified on a class.
+ *
+ * @since Common Annotations 1.0
+ */
+@Documented
+@Retention (RUNTIME)
+@Target(TYPE)
public @interface DeclareRoles {
- public String[] value();
+ String[] value();
}
Modified: trunk/java/javax/annotation/security/DenyAll.java
===================================================================
--- trunk/java/javax/annotation/security/DenyAll.java 2009-10-28 15:08:23 UTC (rev 1227)
+++ trunk/java/javax/annotation/security/DenyAll.java 2009-10-29 00:54:53 UTC (rev 1228)
@@ -1,30 +1,46 @@
/*
- * 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
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the "License"). You may not use this file except
+ * in compliance with the License.
*
- *
http://www.apache.org/licenses/LICENSE-2.0
+ * You can obtain a copy of the license at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt or
+ *
https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
*
- * 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.
+ * When distributing Covered Code, include this CDDL
+ * HEADER in each file and include the License file at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
+ * add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your
+ * own identifying information: Portions Copyright [yyyy]
+ * [name of copyright owner]
*/
+/*
+ *
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
package javax.annotation.security;
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-(a)Target({ElementType.METHOD})
-(a)Retention(RetentionPolicy.RUNTIME)
-
+/**
+ * Specifies that no security roles are allowed to invoke the specified
+ * method(s) - i.e that the methods are to be excluded from execution in
+ * the J2EE container.
+ *
+ * @see javax.annotation.security.RolesAllowed
+ * @see javax.annotation.security.PermitAll
+ * @since Common Annotations 1.0
+ */
+@Documented
+@Retention (RUNTIME)
+@Target({TYPE, METHOD})
public @interface DenyAll {
}
Modified: trunk/java/javax/annotation/security/PermitAll.java
===================================================================
--- trunk/java/javax/annotation/security/PermitAll.java 2009-10-28 15:08:23 UTC (rev
1227)
+++ trunk/java/javax/annotation/security/PermitAll.java 2009-10-29 00:54:53 UTC (rev
1228)
@@ -1,30 +1,51 @@
/*
- * 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
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the "License"). You may not use this file except
+ * in compliance with the License.
*
- *
http://www.apache.org/licenses/LICENSE-2.0
+ * You can obtain a copy of the license at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt or
+ *
https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
*
- * 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.
+ * When distributing Covered Code, include this CDDL
+ * HEADER in each file and include the License file at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
+ * add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your
+ * own identifying information: Portions Copyright [yyyy]
+ * [name of copyright owner]
*/
+/*
+ *
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
package javax.annotation.security;
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-(a)Target({ElementType.TYPE, ElementType.METHOD})
-(a)Retention(RetentionPolicy.RUNTIME)
-
+/**
+ * Specifies that all security roles are allowed to invoke the specified
+ * method(s) i.e that the specified method(s) are "unchecked". It can be
+ * specified on a class or on methods. Specifying it on the class means that
+ * it applies to all methods of the class. If specified at the method level,
+ * it only affects that method. If the RolesAllowed is specified at the class
+ * level and this annotation is applied at the method level, the PermitAll
+ * annotation overrides the RolesAllowed for the specified method.
+ *
+ * @see javax.annotation.security.RolesAllowed
+ * @see javax.annotation.security.DenyAll
+ *
+ * @since Common Annotations 1.0
+ */
+@Documented
+@Retention (RUNTIME)
+@Target({TYPE, METHOD})
public @interface PermitAll {
}
Modified: trunk/java/javax/annotation/security/RolesAllowed.java
===================================================================
--- trunk/java/javax/annotation/security/RolesAllowed.java 2009-10-28 15:08:23 UTC (rev
1227)
+++ trunk/java/javax/annotation/security/RolesAllowed.java 2009-10-29 00:54:53 UTC (rev
1228)
@@ -1,31 +1,49 @@
/*
- * 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
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the "License"). You may not use this file except
+ * in compliance with the License.
*
- *
http://www.apache.org/licenses/LICENSE-2.0
+ * You can obtain a copy of the license at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt or
+ *
https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
*
- * 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.
+ * When distributing Covered Code, include this CDDL
+ * HEADER in each file and include the License file at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
+ * add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your
+ * own identifying information: Portions Copyright [yyyy]
+ * [name of copyright owner]
*/
+/*
+ *
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
package javax.annotation.security;
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-(a)Target({ElementType.TYPE, ElementType.METHOD})
-(a)Retention(RetentionPolicy.RUNTIME)
-
+/**
+ * Specifies the list of roles permitted to access method(s) in an application.
+ * The value of the RolesAllowed annotation is a list of security role names.
+ * This annotation can be specified on a class or on method(s). Specifying it
+ * at a class level means that it applies to all the methods in the class.
+ * Specifying it on a method means that it is applicable to that method only.
+ * If applied at both the class and methods level , the method value overrides
+ * the class value if the two conflict.
+ *
+ * @since Common Annotations 1.0
+ */
+@Documented
+@Retention (RUNTIME)
+@Target({TYPE, METHOD})
public @interface RolesAllowed {
- public String[] value();
+ String[] value();
}
Modified: trunk/java/javax/annotation/security/RunAs.java
===================================================================
--- trunk/java/javax/annotation/security/RunAs.java 2009-10-28 15:08:23 UTC (rev 1227)
+++ trunk/java/javax/annotation/security/RunAs.java 2009-10-29 00:54:53 UTC (rev 1228)
@@ -1,31 +1,46 @@
/*
- * 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
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the "License"). You may not use this file except
+ * in compliance with the License.
*
- *
http://www.apache.org/licenses/LICENSE-2.0
+ * You can obtain a copy of the license at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt or
+ *
https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
*
- * 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.
+ * When distributing Covered Code, include this CDDL
+ * HEADER in each file and include the License file at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
+ * add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your
+ * own identifying information: Portions Copyright [yyyy]
+ * [name of copyright owner]
*/
+/*
+ *
+ * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
package javax.annotation.security;
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-(a)Target({ElementType.TYPE})
-(a)Retention(RetentionPolicy.RUNTIME)
-
+/**
+ * Defines the identity of the application during execution in a J2EE
+ * container. This allows developers to execute under a particular role.
+ * The role must map to the user / group information in the containers
+ * security realm. It's value is the name of a security role.
+ *
+ * @since Common Annotations 1.0
+ */
+@Documented
+@Retention (RUNTIME)
+@Target(TYPE)
public @interface RunAs {
- public String value();
+ String value();
}
Added: trunk/java/javax/annotation/security/package.html
===================================================================
--- trunk/java/javax/annotation/security/package.html (rev 0)
+++ trunk/java/javax/annotation/security/package.html 2009-10-29 00:54:53 UTC (rev 1228)
@@ -0,0 +1,28 @@
+<!--
+
+ The contents of this file are subject to the terms
+ of the Common Development and Distribution License
+ (the "License"). You may not use this file except
+ in compliance with the License.
+
+ You can obtain a copy of the license at
+ glassfish/bootstrap/legal/CDDLv1.0.txt or
+
https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ See the License for the specific language governing
+ permissions and limitations under the License.
+
+ When distributing Covered Code, include this CDDL
+ HEADER in each file and include the License file at
+ glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
+ add the following below this CDDL HEADER, with the
+ fields enclosed by brackets "[]" replaced with your
+ own identifying information: Portions Copyright [yyyy]
+ [name of copyright owner]
+
+ Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+-->
+<html>
+<body>
+ This package contains the security common annotations.
+</body>
+</html>
Added: trunk/java/javax/annotation/sql/DataSourceDefinition.java
===================================================================
--- trunk/java/javax/annotation/sql/DataSourceDefinition.java (rev
0)
+++ trunk/java/javax/annotation/sql/DataSourceDefinition.java 2009-10-29 00:54:53 UTC (rev
1228)
@@ -0,0 +1,278 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the "License"). You may not use this file except
+ * in compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt or
+ *
https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * HEADER in each file and include the License file at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
+ * add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your
+ * own identifying information: Portions Copyright [yyyy]
+ * [name of copyright owner]
+ */
+
+/*
+ *
+ * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
+
+package javax.annotation.sql;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Annotation used to define a container <code>DataSource</code> and
+ * be registered with JNDI. The <code>DataSource</code> may be configured by
+ * setting the annotation elements for commonly used <code>DataSource</code>
+ * properties. Additional standard and vendor-specific properties may be
+ * specified using the <code>properties</code> element.
+ * <p>
+ *
+ * The data source will be registered under the name specified in the
+ * <code>name</code> element. It may be defined to be in any valid
+ * <code>Java EE</code> namespace, and will determine the accessibility of
+ * the data source from other components.
+ * <p>
+ * A JDBC driver implementation class of the appropriate type, either
+ * <code>DataSource</code>,
<code>ConnectionPoolDataSource</code>, or
+ * <code>XADataSource</code>, must be indicated by the
<code>className</code>
+ * element. The availability of the driver class will be assumed at runtime.
+ *<p>
+ * The <code>url</code> property should not be specified in conjunction with
+ * other standard properties for defining the connectivity to the database.
+ * If the <code>url</code> property is specified along with other standard
+ * <code>DataSource</code> properties
+ * such as <code>serverName</code> and <code>portNumber</code>,
the more
+ * specific properties will take precedence and <code>url</code> will be
+ * ignored.
+ * <p>
+ * Vendors are not required to support properties that do not normally
+ * apply to a specific data source type. For example, specifying the
+ * <code>transactional</code> property to be <code>true</code>
but supplying
+ * a value for <code>className</code> that implements a data source class
+ * other than <code>XADataSource</code> may not be supported.
+ * <p>
+ * Vendor-specific properties may be combined with or used to
+ * override standard data source properties defined using this annotation.
+ * <p>
+ * <code>DataSource</code> properties that are specified and are not
supported
+ * in a given configuration or cannot be mapped to a vendor specific
+ * configuration property may be ignored.
+ * <p>
+ * Examples:
+ * <br>
+ * <pre>
+ * @DataSourceDefinition(name="java:global/MyApp/MyDataSource",
+ * className="com.foobar.MyDataSource",
+ * portNumber=6689,
+ * serverName="myserver.com",
+ * user="lance",
+ * password="secret"
+ * )
+ *
+ * </pre>
+ * <p>
+ * Using a <code>URL</code>:
+ * <br>
+ * <pre>
+ * @DataSourceDefinition(name="java:global/MyApp/MyDataSource",
+ * className="org.apache.derby.jdbc.ClientDataSource",
+ * url="jdbc:derby://localhost:1527/myDB",
+ * user="lance",
+ * password="secret"
+ * )
+ * </pre>
+ * <p>
+ * An example lookup of the {@link DataSource} from an EJB:
+ * <pre>
+ * @Stateless
+ * public class MyStatelessEJB {
+ * @Resource(lookup="java:global/MyApp/myDataSource")
+ * DataSource myDB;
+ * ...
+ * }
+ * </pre>
+ * <p>
+ * @see javax.sql.DataSource
+ * @see javax.sql.XADataSource
+ * @see javax.sql.ConnectionPoolDataSource
+ * @since Common Annotations 1.1
+ */
+(a)Target({ElementType.TYPE})
+(a)Retention(RetentionPolicy.RUNTIME)
+public @interface DataSourceDefinition {
+
+ /**
+ * JNDI name by which the data source will be registered.
+ * @since 1.1
+ */
+ String name();
+
+ /**
+ * DataSource implementation class name which implements:
+ * <code>javax.sql.DataSource</code> or
<code>javax.sql.XADataSource</code>
+ * or <code>javax.sql.ConnectionPoolDataSource</code>.
+ * @since 1.1
+ */
+ String className();
+
+ /**
+ * Description of this data source
+ * @since 1.1
+ */
+ String description() default "";
+
+ /**
+ * A JDBC URL. If the <code>url</code> property is specified along with
+ * other standard <code>DataSource</code> properties
+ * such as <code>serverName</code> and
<code>portNumber</code>, the more
+ * specific properties will take precedence and <code>url</code> will be
+ * ignored.
+ * @since 1.1
+ */
+ String url() default "";
+
+ /**
+ * User name to use for connection authentication.
+ * @since 1.1
+ */
+ String user() default "";
+
+ /**
+ * Password to use for connection authentication.
+ * @since 1.1
+ */
+ String password() default "";
+
+ /**
+ * Name of a database on a server.
+ * @since 1.1
+ */
+ String databaseName() default "";
+
+ /**
+ * Port number where a server is listening for requests.
+ * @since 1.1
+ */
+ int portNumber() default -1;
+
+ /**
+ * Database server name.
+ * @since 1.1
+ */
+ String serverName() default "localhost";
+
+ /**
+ * Isolation level for connections. The Isolation level
+ * must be one of the following:
+ * <p>
+ * <ul>
+ * <li>Connection.TRANSACTION_NONE,
+ * <li>Connection.TRANSACTION_READ_ UNCOMMITTED,
+ * <li>Connection.TRANSACTION_READ_COMMITTED,
+ * <li>Connection.TRANSACTION_REPEATABLE_READ,
+ * <li>Connection.TRANSACTION_SERIALIZABLE
+ *</ul>
+ * <p>
+ * Default is vendor-specific.
+ * @since 1.1
+ */
+ int isolationLevel() default -1;
+
+ /**
+ * Set to <code>false</code> if connections should not participate
+ * in transactions.
+ * <p>
+ * Default is to enlist in a transaction when one is active or becomes
+ * active.
+ * @since 1.1
+ */
+ boolean transactional() default true;
+
+ /**
+ * Number of connections that should be created when a connection pool
+ * is initialized.
+ * <p>
+ * Default is vendor-specific
+ * @since 1.1
+ */
+ int initialPoolSize() default -1;
+
+ /**
+ * Maximum number of connections that should be concurrently allocated for a
+ * connection pool.
+ * <p>
+ * Default is vendor-specific.
+ * @since 1.1
+ */
+ int maxPoolSize() default -1;
+
+ /**
+ * Minimum number of connections that should be allocated for a
+ * connection pool.
+ * <p>
+ * Default is vendor-specific.
+ * @since 1.1
+ */
+ int minPoolSize() default -1;
+
+ /**
+ * The number of seconds that a physical connection
+ * should remain unused in the pool before the
+ * connection is closed for a connection pool.
+ * <p>
+ * Default is vendor-specific
+ * @since 1.1
+ */
+ int maxIdleTime() default -1;
+
+ /**
+ * The total number of statements that a connection pool should keep open.
+ * A value of 0 indicates that the caching of statements is disabled for
+ * a connection pool.
+ * <p>
+ * Default is vendor-specific
+ * @since 1.1
+ */
+ int maxStatements() default -1;
+ /**
+ * Used to specify Vendor specific properties and less commonly
+ * used <code>DataSource</code> properties such as:
+ * <p>
+ * <ul>
+ * <li>dataSourceName
+ * <li>networkProtocol
+ * <li>propertyCycle
+ * <li>roleName
+ * </ul>
+ * <p>
+ * Properties are specified using the format:
+ * <i>propertyName=propertyValue</i> with one property per array
element.
+ * @since 1.1
+ */
+ String[] properties() default {};
+
+
+ /**
+ * Sets the maximum time in seconds that this data source will wait while
+ * attempting to connect to a database. A value of zero specifies that
+ * the timeout is the default system timeout if there is one; otherwise,
+ * it specifies that there is no timeout.
+ * <p>
+ * Default is vendor-specific.
+ * @since 1.1
+ */
+ int loginTimeout() default 0;
+}
Added: trunk/java/javax/annotation/sql/DataSourceDefinitions.java
===================================================================
--- trunk/java/javax/annotation/sql/DataSourceDefinitions.java
(rev 0)
+++ trunk/java/javax/annotation/sql/DataSourceDefinitions.java 2009-10-29 00:54:53 UTC
(rev 1228)
@@ -0,0 +1,46 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the "License"). You may not use this file except
+ * in compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt or
+ *
https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * HEADER in each file and include the License file at
+ * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
+ * add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your
+ * own identifying information: Portions Copyright [yyyy]
+ * [name of copyright owner]
+ */
+
+/*
+ *
+ * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
+
+package javax.annotation.sql;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Declares one or more <code>DataSourceDefinition</code> annotations.
+ *
+ * @see javax.annotation.sql.DataSourceDefinition
+ * @since Common Annotations 1.1
+ */
+(a)Target({ElementType.TYPE})
+(a)Retention(RetentionPolicy.RUNTIME)
+public @interface DataSourceDefinitions {
+ DataSourceDefinition[] value ();
+
+}