Author: rsivaram
Date: Mon Oct 20 06:04:11 2008
New Revision: 706269
URL: http://svn.apache.org/viewvc?rev=706269&view=rev
Log:
Event prototype: Annotations for producers and consumers
Added:
tuscany/sandbox/event/modules/sca-api/src/main/java/org/osoa/sca/annotations/Consumer.java
(with props)
tuscany/sandbox/event/modules/sca-api/src/main/java/org/osoa/sca/annotations/Producer.java
(with props)
Added:
tuscany/sandbox/event/modules/sca-api/src/main/java/org/osoa/sca/annotations/Consumer.java
URL:
http://svn.apache.org/viewvc/tuscany/sandbox/event/modules/sca-api/src/main/java/org/osoa/sca/annotations/Consumer.java?rev=706269&view=auto
==============================================================================
---
tuscany/sandbox/event/modules/sca-api/src/main/java/org/osoa/sca/annotations/Consumer.java
(added)
+++
tuscany/sandbox/event/modules/sca-api/src/main/java/org/osoa/sca/annotations/Consumer.java
Mon Oct 20 06:04:11 2008
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate the consumer method exposed by a Java class.
+ *
+ * @version $$
+ */
[EMAIL PROTECTED]({METHOD})
[EMAIL PROTECTED](RUNTIME)
+public @interface Consumer {
+
+ String name() default "";
+
+}
Propchange:
tuscany/sandbox/event/modules/sca-api/src/main/java/org/osoa/sca/annotations/Consumer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tuscany/sandbox/event/modules/sca-api/src/main/java/org/osoa/sca/annotations/Consumer.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
tuscany/sandbox/event/modules/sca-api/src/main/java/org/osoa/sca/annotations/Producer.java
URL:
http://svn.apache.org/viewvc/tuscany/sandbox/event/modules/sca-api/src/main/java/org/osoa/sca/annotations/Producer.java?rev=706269&view=auto
==============================================================================
---
tuscany/sandbox/event/modules/sca-api/src/main/java/org/osoa/sca/annotations/Producer.java
(added)
+++
tuscany/sandbox/event/modules/sca-api/src/main/java/org/osoa/sca/annotations/Producer.java
Mon Oct 20 06:04:11 2008
@@ -0,0 +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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+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.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a constructor parameter, field or method that
is used to inject a producer.
+ *
+ * @version $$
+ */
[EMAIL PROTECTED]({METHOD, FIELD, PARAMETER})
[EMAIL PROTECTED](RUNTIME)
+public @interface Producer {
+ /**
+ * The name of the producer. If not specified then the name will be
derived from the annotated field or method.
+ *
+ * @return the name of the producer
+ */
+ String name() default "";
+
+ /**
+ * Indicates if a producer must be specified.
+ *
+ * @return true if a producer must be specified
+ */
+ boolean required() default true;
+}
+
Propchange:
tuscany/sandbox/event/modules/sca-api/src/main/java/org/osoa/sca/annotations/Producer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tuscany/sandbox/event/modules/sca-api/src/main/java/org/osoa/sca/annotations/Producer.java
------------------------------------------------------------------------------
svn:keywords = Rev Date