From: remm Date: Wed, 21 Jun 2006 09:21:32 +0000 (+0000) Subject: - Fix annotation names. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=8975d3629d45e5d2e80273ab5113f2969811725a;p=tomcat7.0 - Fix annotation names. git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@415948 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/javax/annotation/EJB.java b/java/javax/annotation/EJB.java deleted file mode 100644 index 13b308e6b..000000000 --- a/java/javax/annotation/EJB.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2006 The Apache Software Foundation. - * - * 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 java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target({ElementType.METHOD, ElementType.TYPE, ElementType.FIELD, ElementType.PARAMETER}) -@Retention(RetentionPolicy.RUNTIME) - -public @interface EJB { - String name() default ""; - Class businessInterface() default java.lang.Object.class; - String beanName() default ""; - String mappedName() default ""; - String description() default ""; -} diff --git a/java/javax/annotation/EJBs.java b/java/javax/annotation/EJBs.java deleted file mode 100644 index 62e7a9ae0..000000000 --- a/java/javax/annotation/EJBs.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2006 The Apache Software Foundation. - * - * 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 java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) - -public @interface EJBs { - EJB[] value(); -} diff --git a/java/javax/annotation/security/DeclareRoles.java b/java/javax/annotation/security/DeclareRoles.java new file mode 100644 index 000000000..95f8aa194 --- /dev/null +++ b/java/javax/annotation/security/DeclareRoles.java @@ -0,0 +1,30 @@ +/* + * Copyright 2006 The Apache Software Foundation. + * + * 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.security; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) + +public @interface DeclareRoles { + public String[] value(); +} diff --git a/java/javax/annotation/security/DeclaresRoles.java b/java/javax/annotation/security/DeclaresRoles.java deleted file mode 100644 index ccbd951c8..000000000 --- a/java/javax/annotation/security/DeclaresRoles.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2006 The Apache Software Foundation. - * - * 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.security; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) - -public @interface DeclaresRoles { - public String[] value(); -} diff --git a/java/javax/ejb/EJB.java b/java/javax/ejb/EJB.java new file mode 100644 index 000000000..0a4e44556 --- /dev/null +++ b/java/javax/ejb/EJB.java @@ -0,0 +1,34 @@ +/* + * Copyright 2006 The Apache Software Foundation. + * + * 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.ejb; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.METHOD, ElementType.TYPE, ElementType.FIELD, ElementType.PARAMETER}) +@Retention(RetentionPolicy.RUNTIME) + +public @interface EJB { + String name() default ""; + Class businessInterface() default java.lang.Object.class; + String beanName() default ""; + String mappedName() default ""; + String description() default ""; +} diff --git a/java/javax/ejb/EJBs.java b/java/javax/ejb/EJBs.java new file mode 100644 index 000000000..50ed5d929 --- /dev/null +++ b/java/javax/ejb/EJBs.java @@ -0,0 +1,30 @@ +/* + * Copyright 2006 The Apache Software Foundation. + * + * 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.ejb; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) + +public @interface EJBs { + EJB[] value(); +} diff --git a/java/org/apache/catalina/startup/WebAnnotationSet.java b/java/org/apache/catalina/startup/WebAnnotationSet.java index eef024aa0..f2261d13a 100644 --- a/java/org/apache/catalina/startup/WebAnnotationSet.java +++ b/java/org/apache/catalina/startup/WebAnnotationSet.java @@ -20,7 +20,7 @@ package org.apache.catalina.startup; import javax.annotation.Resource; import javax.annotation.Resources; -import javax.annotation.security.DeclaresRoles; +import javax.annotation.security.DeclareRoles; import javax.annotation.security.RunAs; import org.apache.catalina.Container; @@ -240,9 +240,9 @@ public class WebAnnotationSet { * Ref JSR 250, equivalent to the security-role element in * the deployment descriptor */ - if (classClass.isAnnotationPresent(DeclaresRoles.class)) { - DeclaresRoles annotation = (DeclaresRoles) - classClass.getAnnotation(DeclaresRoles.class); + if (classClass.isAnnotationPresent(DeclareRoles.class)) { + DeclareRoles annotation = (DeclareRoles) + classClass.getAnnotation(DeclareRoles.class); for (int i = 0; annotation.value() != null && i < annotation.value().length; i++) { context.addSecurityRole(annotation.value()[i]); } diff --git a/java/org/apache/catalina/util/AnnotationProcessor.java b/java/org/apache/catalina/util/AnnotationProcessor.java index 9288eb654..6e11428f6 100644 --- a/java/org/apache/catalina/util/AnnotationProcessor.java +++ b/java/org/apache/catalina/util/AnnotationProcessor.java @@ -21,10 +21,10 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import javax.annotation.EJB; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.annotation.Resource; +import javax.ejb.EJB; import javax.naming.NamingException; import javax.persistence.PersistenceContext; import javax.persistence.PersistenceUnit; diff --git a/java/org/apache/jasper/runtime/AnnotationProcessor.java b/java/org/apache/jasper/runtime/AnnotationProcessor.java index 915e5f4d7..c9a3197b4 100644 --- a/java/org/apache/jasper/runtime/AnnotationProcessor.java +++ b/java/org/apache/jasper/runtime/AnnotationProcessor.java @@ -21,10 +21,10 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import javax.annotation.EJB; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.annotation.Resource; +import javax.ejb.EJB; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException;