You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by cs...@apache.org on 2016/05/09 14:48:23 UTC

[04/35] karaf-boot git commit: Refactoring of karaf-boot

http://git-wip-us.apache.org/repos/asf/karaf-boot/blob/87577122/karaf-boot/src/main/java/org/apache/karaf/boot/Inject.java
----------------------------------------------------------------------
diff --git a/karaf-boot/src/main/java/org/apache/karaf/boot/Inject.java b/karaf-boot/src/main/java/org/apache/karaf/boot/Inject.java
deleted file mode 100644
index e0a0bd7..0000000
--- a/karaf-boot/src/main/java/org/apache/karaf/boot/Inject.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- *  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.apache.karaf.boot;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Inject {
-    String value() default "";
-    String name() default "";
-    String description() default "";
-    String ref() default "";
-    String[] values() default {};
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/karaf-boot/blob/87577122/karaf-boot/src/main/java/org/apache/karaf/boot/List.java
----------------------------------------------------------------------
diff --git a/karaf-boot/src/main/java/org/apache/karaf/boot/List.java b/karaf-boot/src/main/java/org/apache/karaf/boot/List.java
deleted file mode 100644
index f171908..0000000
--- a/karaf-boot/src/main/java/org/apache/karaf/boot/List.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- *  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.apache.karaf.boot;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * used to annotate list value in property
- * I am not convinced that we want to support this via annotation
- *
- */
-@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface List {
-    
-    // the element of the list
-    public Element[] value();
-  
-}

http://git-wip-us.apache.org/repos/asf/karaf-boot/blob/87577122/karaf-boot/src/main/java/org/apache/karaf/boot/Reference.java
----------------------------------------------------------------------
diff --git a/karaf-boot/src/main/java/org/apache/karaf/boot/Reference.java b/karaf-boot/src/main/java/org/apache/karaf/boot/Reference.java
deleted file mode 100644
index ee8d474..0000000
--- a/karaf-boot/src/main/java/org/apache/karaf/boot/Reference.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- *  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.apache.karaf.boot;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target(ElementType.FIELD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Reference
-{    
-    /**
-     * the description property of the service reference
-     */
-    String description() default "";
-    
-    /**
-     * the interface type that a matching service must support.
-     */
-    Class<?> serviceInterface() default Object.class;
-    
-    /**
-     * the filter expression that a matching service must match.
-     */
-    String filter() default "";
-    
-    /**
-     * the <code>component-name</code> attribute of the service reference.
-     */
-    String componentName() default "";
-    
-    /**
-     * whether or not a matching service is required at all times.  either optional or mandatory.
-     */
-    String availability() default "";
-    
-    /**
-     * the reference listeners for the service reference, to receive bind and unbind events.
-     */
-    ReferenceListener[] referenceListeners() default {};
-
-    /**
-     * the timeout property.  If the timeout is not specified,
-     * the default-timeout value is inherited from the encapsulating
-     * <code><blueprint></code> definition.
-     */
-    int timeout() default 0;
-    
-    /**
-     * the id for the reference
-     */
-    String id() default "";
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/karaf-boot/blob/87577122/karaf-boot/src/main/java/org/apache/karaf/boot/ReferenceList.java
----------------------------------------------------------------------
diff --git a/karaf-boot/src/main/java/org/apache/karaf/boot/ReferenceList.java b/karaf-boot/src/main/java/org/apache/karaf/boot/ReferenceList.java
deleted file mode 100644
index 9c1378a..0000000
--- a/karaf-boot/src/main/java/org/apache/karaf/boot/ReferenceList.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- *  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.apache.karaf.boot;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target(ElementType.FIELD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface ReferenceList
-{    
-    /**
-     * the description property of the service reference
-     */
-    String description() default "";
-    
-    /**
-     * the interface type that a matching service must support.
-     */
-    Class<?> serviceInterface() default Object.class;
-    
-    /**
-     * the filter expression that a matching service must match.
-     */
-    String filter() default "";
-    
-    /**
-     * the <code>component-name</code> attribute of the service reference.
-     */
-    String componentName() default "";
-    
-    /**
-     * whether or not a matching service is required at all times.  either optional or mandatory.
-     */
-    String availability() default "";
-    
-    /**
-     * the reference listeners for the service reference, to receive bind and unbind events.
-     */
-    ReferenceListener[] referenceListeners() default {};
-    
-    /**
-     * the value of the memberType property.
-     */
-    String memberType() default "service-object";
-    
-    /**
-     * the id for the referencelist
-     */
-    String id() default "";
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/karaf-boot/blob/87577122/karaf-boot/src/main/java/org/apache/karaf/boot/ReferenceListener.java
----------------------------------------------------------------------
diff --git a/karaf-boot/src/main/java/org/apache/karaf/boot/ReferenceListener.java b/karaf-boot/src/main/java/org/apache/karaf/boot/ReferenceListener.java
deleted file mode 100644
index 725a220..0000000
--- a/karaf-boot/src/main/java/org/apache/karaf/boot/ReferenceListener.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- *  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.apache.karaf.boot;
-
-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 ReferenceListener {
-    String ref() default "";
-}

http://git-wip-us.apache.org/repos/asf/karaf-boot/blob/87577122/karaf-boot/src/main/java/org/apache/karaf/boot/Register.java
----------------------------------------------------------------------
diff --git a/karaf-boot/src/main/java/org/apache/karaf/boot/Register.java b/karaf-boot/src/main/java/org/apache/karaf/boot/Register.java
deleted file mode 100644
index 41bb50d..0000000
--- a/karaf-boot/src/main/java/org/apache/karaf/boot/Register.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- *  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.apache.karaf.boot;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * used to annotation register-method in blueprint registration listeners
- *
- */
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Register {
-}

http://git-wip-us.apache.org/repos/asf/karaf-boot/blob/87577122/karaf-boot/src/main/java/org/apache/karaf/boot/RegistrationListener.java
----------------------------------------------------------------------
diff --git a/karaf-boot/src/main/java/org/apache/karaf/boot/RegistrationListener.java b/karaf-boot/src/main/java/org/apache/karaf/boot/RegistrationListener.java
deleted file mode 100644
index 793e2dd..0000000
--- a/karaf-boot/src/main/java/org/apache/karaf/boot/RegistrationListener.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- *  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.apache.karaf.boot;
-
-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 RegistrationListener {
-
-    String ref() default "";
-}

http://git-wip-us.apache.org/repos/asf/karaf-boot/blob/87577122/karaf-boot/src/main/java/org/apache/karaf/boot/Service.java
----------------------------------------------------------------------
diff --git a/karaf-boot/src/main/java/org/apache/karaf/boot/Service.java b/karaf-boot/src/main/java/org/apache/karaf/boot/Service.java
deleted file mode 100644
index 09b6293..0000000
--- a/karaf-boot/src/main/java/org/apache/karaf/boot/Service.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- *  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.apache.karaf.boot;
-
-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 Service {
-    
-    /**
-     * the registration listeners to be notified when the service is
-     * registered and unregistered with the framework.
-     */
-    RegistrationListener[] registerationListeners() default {};
-    
-    /**
-     *  the ranking value to use when advertising the service.  If the
-     *  ranking value is zero, the service must be registered without a
-     *  <code>service.ranking</code> service property. 
-     */
-    int ranking() default 0;
-    
-    /**
-     *  the auto-export mode for the service.  
-     *  possible values are disabled, interfaces, class_hierarchy, all_classes
-     */
-    String autoExport() default "";
-    
-    /**
-     *  the interfaces that the service should be advertised as supporting.
-     */
-    Class<?>[] interfaces() default {};
-    
-    /**
-     * the user declared properties to be advertised with the service.
-     */
-    ServiceProperty[] serviceProperties() default {};
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/karaf-boot/blob/87577122/karaf-boot/src/main/java/org/apache/karaf/boot/ServiceProperty.java
----------------------------------------------------------------------
diff --git a/karaf-boot/src/main/java/org/apache/karaf/boot/ServiceProperty.java b/karaf-boot/src/main/java/org/apache/karaf/boot/ServiceProperty.java
deleted file mode 100644
index a6ca33d..0000000
--- a/karaf-boot/src/main/java/org/apache/karaf/boot/ServiceProperty.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- *  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.apache.karaf.boot;
-
-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 ServiceProperty {
-    /**
-     * the key of the property
-     */
-    String key() default "";
-    
-    /**
-     * the value of the property
-     */
-    String value() default "";
-}

http://git-wip-us.apache.org/repos/asf/karaf-boot/blob/87577122/karaf-boot/src/main/java/org/apache/karaf/boot/Unbind.java
----------------------------------------------------------------------
diff --git a/karaf-boot/src/main/java/org/apache/karaf/boot/Unbind.java b/karaf-boot/src/main/java/org/apache/karaf/boot/Unbind.java
deleted file mode 100644
index dbe15d1..0000000
--- a/karaf-boot/src/main/java/org/apache/karaf/boot/Unbind.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- *  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.apache.karaf.boot;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * used to annotation unbind-method in blueprint reference listeners
- *
- */
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Unbind {
-}

http://git-wip-us.apache.org/repos/asf/karaf-boot/blob/87577122/karaf-boot/src/main/java/org/apache/karaf/boot/Unregister.java
----------------------------------------------------------------------
diff --git a/karaf-boot/src/main/java/org/apache/karaf/boot/Unregister.java b/karaf-boot/src/main/java/org/apache/karaf/boot/Unregister.java
deleted file mode 100644
index 04ea698..0000000
--- a/karaf-boot/src/main/java/org/apache/karaf/boot/Unregister.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- *  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.apache.karaf.boot;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * used to annotation unregister-method in blueprint registration listeners
- *
- */
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Unregister {
-}

http://git-wip-us.apache.org/repos/asf/karaf-boot/blob/87577122/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2c7f8ac..3650256 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,15 +29,31 @@
         Apache Karaf Boot provides a simple way to create artifacts ready to be deployed in Karaf.
     </description>
 
+    <properties>
+        <karaf.version>4.0.1</karaf.version>
+        <osgi.version>6.0.0</osgi.version>
+    </properties>
+
     <modules>
-        <module>karaf-boot</module>
-        <module>karaf-boot-starter</module>
+        <module>karaf-boot-starters</module>
         <module>karaf-boot-tools</module>
 
-        <module>karaf-boot-parent</module>
+        <!-- TODO reuse @Services & @Reference shell annotations for generic use cases -->
 
         <!-- Samples -->
-        <module>karaf-boot-samples/karaf-boot-sample-simple</module>
+        <module>karaf-boot-samples/karaf-boot-sample-service-provider-osgi</module>
+        <module>karaf-boot-samples/karaf-boot-sample-service-consumer-osgi</module>
+        <module>karaf-boot-samples/karaf-boot-sample-service-provider-ds</module>
+        <module>karaf-boot-samples/karaf-boot-sample-service-consumer-ds</module>
+        <!-- blueprint -->
+        <!-- cdi -->
+        <!-- shell -->
+        <!-- config -->
+        <!-- jpa -->
+        <!-- servlet -->
+        <!-- test -->
+        <!-- rest & soap -->
+        <!-- camel -->
     </modules>
 
 </project>