aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject svn commit: r1075149 [16/23] - in /aries/tags/blueprint-0.3.1: ./ blueprint-annotation-api/ blueprint-annotation-api/src/ blueprint-annotation-api/src/main/ blueprint-annotation-api/src/main/java/ blueprint-annotation-api/src/main/java/org/ blueprint-a...
Date Sun, 27 Feb 2011 21:21:22 GMT
Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableMapEntry.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableMapEntry.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableMapEntry.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableMapEntry.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,36 @@
+/**
+ * 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.aries.blueprint.mutable;
+
+import org.osgi.service.blueprint.reflect.MapEntry;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.osgi.service.blueprint.reflect.NonNullMetadata;
+
+/**
+ * A mutable version of the <code>MapEntry</code> that allows modifications.
+ *
+ * @version $Rev: 896324 $, $Date: 2010-01-06 06:05:04 +0000 (Wed, 06 Jan 2010) $
+ */
+public interface MutableMapEntry extends MapEntry {
+
+    void setKey(NonNullMetadata key);
+
+    void setValue(Metadata value);
+
+}
\ No newline at end of file

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableMapMetadata.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableMapMetadata.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableMapMetadata.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableMapMetadata.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,43 @@
+/**
+ * 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.aries.blueprint.mutable;
+
+import org.osgi.service.blueprint.reflect.MapEntry;
+import org.osgi.service.blueprint.reflect.MapMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.osgi.service.blueprint.reflect.NonNullMetadata;
+
+/**
+ * A mutable version of the <code>MapMetadata</code> that allows modifications.
+ *
+ * @version $Rev: 896324 $, $Date: 2010-01-06 06:05:04 +0000 (Wed, 06 Jan 2010) $
+ */
+public interface MutableMapMetadata extends MapMetadata {
+
+    void setKeyType(String keyType);
+
+    void setValueType(String valueType);
+
+    void addEntry(MapEntry entry);
+
+    MapEntry addEntry(NonNullMetadata key, Metadata value);
+
+    void removeEntry(MapEntry entry);
+
+}
\ No newline at end of file

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutablePassThroughMetadata.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutablePassThroughMetadata.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutablePassThroughMetadata.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutablePassThroughMetadata.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,30 @@
+/**
+ * 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.aries.blueprint.mutable;
+
+import org.apache.aries.blueprint.PassThroughMetadata;
+
+/**
+ * The mutable version of the PassThroughMetadata interface
+ */
+public interface MutablePassThroughMetadata extends PassThroughMetadata, MutableComponentMetadata {
+
+    void setObject(Object object);
+
+}

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutablePropsMetadata.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutablePropsMetadata.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutablePropsMetadata.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutablePropsMetadata.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,39 @@
+/**
+ * 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.aries.blueprint.mutable;
+
+import org.osgi.service.blueprint.reflect.MapEntry;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.osgi.service.blueprint.reflect.NonNullMetadata;
+import org.osgi.service.blueprint.reflect.PropsMetadata;
+
+/**
+ * A mutable version of the <code>PropsMetadata</code> that allows modifications.
+ *
+ * @version $Rev: 896324 $, $Date: 2010-01-06 06:05:04 +0000 (Wed, 06 Jan 2010) $
+ */
+public interface MutablePropsMetadata extends PropsMetadata {
+
+    void addEntry(MapEntry entry);
+
+    MapEntry addEntry(NonNullMetadata key, Metadata value);
+
+    void removeEntry(MapEntry entry);
+
+}
\ No newline at end of file

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableRefMetadata.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableRefMetadata.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableRefMetadata.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableRefMetadata.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,32 @@
+/**
+ * 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.aries.blueprint.mutable;
+
+import org.osgi.service.blueprint.reflect.RefMetadata;
+
+/**
+ * A mutable version of the <code>RefMetadata</code> that allows modifications.
+ *
+ * @version $Rev: 896324 $, $Date: 2010-01-06 06:05:04 +0000 (Wed, 06 Jan 2010) $
+ */
+public interface MutableRefMetadata extends RefMetadata {
+
+    public void setComponentId(String componentId);
+
+}

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableReferenceListMetadata.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableReferenceListMetadata.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableReferenceListMetadata.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableReferenceListMetadata.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,32 @@
+/**
+ * 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.aries.blueprint.mutable;
+
+import org.apache.aries.blueprint.ExtendedReferenceListMetadata;
+
+/**
+ * A mutable version of the <code>RefCollectionMetadata</code> that allows modifications.
+ *
+ * @version $Rev: 896324 $, $Date: 2010-01-06 06:05:04 +0000 (Wed, 06 Jan 2010) $
+ */
+public interface MutableReferenceListMetadata extends ExtendedReferenceListMetadata, MutableServiceReferenceMetadata {
+
+    void setMemberType(int memberType);
+
+}
\ No newline at end of file

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableReferenceListener.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableReferenceListener.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableReferenceListener.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableReferenceListener.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,37 @@
+/**
+ * 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.aries.blueprint.mutable;
+
+import org.osgi.service.blueprint.reflect.ReferenceListener;
+import org.osgi.service.blueprint.reflect.Target;
+
+/**
+ * A mutable version of the <code>Listener</code> that allows modifications.
+ *
+ * @version $Rev: 896324 $, $Date: 2010-01-06 06:05:04 +0000 (Wed, 06 Jan 2010) $
+ */
+public interface MutableReferenceListener extends ReferenceListener {
+
+    void setListenerComponent(Target listenerComponent);
+
+    void setBindMethod(String bindMethodName);
+
+    void setUnbindMethod(String unbindMethodName);
+
+}

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableReferenceMetadata.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableReferenceMetadata.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableReferenceMetadata.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableReferenceMetadata.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,32 @@
+/**
+ * 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.aries.blueprint.mutable;
+
+import org.osgi.service.blueprint.reflect.ReferenceMetadata;
+
+/**
+ * A mutable version of the <code>ReferenceMetadata</code> that allows modifications.
+ *
+ * @version $Rev: 896324 $, $Date: 2010-01-06 06:05:04 +0000 (Wed, 06 Jan 2010) $
+ */
+public interface MutableReferenceMetadata extends ReferenceMetadata, MutableServiceReferenceMetadata {
+
+    void setTimeout(long timeout);
+
+}
\ No newline at end of file

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableRegistrationListener.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableRegistrationListener.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableRegistrationListener.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableRegistrationListener.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,37 @@
+/**
+ * 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.aries.blueprint.mutable;
+
+import org.osgi.service.blueprint.reflect.RegistrationListener;
+import org.osgi.service.blueprint.reflect.Target;
+
+/**
+ * A mutable version of the <code>RegistrationListener</code> that allows modifications.
+ *
+ * @version $Rev: 896324 $, $Date: 2010-01-06 06:05:04 +0000 (Wed, 06 Jan 2010) $
+ */
+public interface MutableRegistrationListener extends RegistrationListener {
+
+    void setListenerComponent(Target listenerComponent);
+
+    void setRegistrationMethod(String registrationMethodName);
+
+    void setUnregistrationMethod(String unregistrationMethodName);
+
+}
\ No newline at end of file

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableServiceMetadata.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableServiceMetadata.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableServiceMetadata.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableServiceMetadata.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,59 @@
+/**
+ * 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.aries.blueprint.mutable;
+
+import org.osgi.service.blueprint.reflect.MapEntry;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.osgi.service.blueprint.reflect.NonNullMetadata;
+import org.osgi.service.blueprint.reflect.RegistrationListener;
+import org.osgi.service.blueprint.reflect.ServiceMetadata;
+import org.osgi.service.blueprint.reflect.Target;
+
+/**
+ * A mutable version of the <code>ServiceMetadata</code> that allows modifications.
+ *
+ * @version $Rev: 896324 $, $Date: 2010-01-06 06:05:04 +0000 (Wed, 06 Jan 2010) $
+ */
+public interface MutableServiceMetadata extends ServiceMetadata, MutableComponentMetadata {
+
+    void setServiceComponent(Target serviceComponent);
+
+    void addInterface(String interfaceName);
+
+    void removeInterface(String interfaceName);
+
+    void setAutoExport(int autoExportMode);
+
+    void addServiceProperty(MapEntry serviceProperty);
+
+    MapEntry addServiceProperty(NonNullMetadata key, Metadata value);
+
+    void removeServiceProperty(MapEntry serviceProperty);
+
+    void setRanking(int ranking);
+
+    void addRegistrationListener(RegistrationListener listener);
+
+    RegistrationListener addRegistrationListener(Target listenerComponent,
+                                                 String registrationMethodName,
+                                                 String unregistrationMethodName);
+
+    void removeRegistrationListener(RegistrationListener listener);
+
+}
\ No newline at end of file

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableServiceReferenceMetadata.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableServiceReferenceMetadata.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableServiceReferenceMetadata.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableServiceReferenceMetadata.java Sun Feb 27 21:21:05 2011
@@ -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.apache.aries.blueprint.mutable;
+
+import org.apache.aries.blueprint.ExtendedServiceReferenceMetadata;
+import org.osgi.service.blueprint.reflect.ReferenceListener;
+import org.osgi.service.blueprint.reflect.Target;
+
+/**
+ * A mutable version of the <code>ServiceReferenceMetadata</code> that allows modifications.
+ *
+ * @version $Rev: 950985 $, $Date: 2010-06-03 14:19:22 +0100 (Thu, 03 Jun 2010) $
+ */
+public interface MutableServiceReferenceMetadata extends ExtendedServiceReferenceMetadata, MutableComponentMetadata {
+
+    void setAvailability(int availability);
+
+    void setInterface(String interfaceName);
+
+    void setComponentName(String componentName);
+
+    void addServiceListener(ReferenceListener listener);
+
+    ReferenceListener addServiceListener(Target listenerComponent,
+                                String bindMethodName,
+                                String unbindMethodName);
+
+    void removeReferenceListener(ReferenceListener listener);
+
+    void setProxyMethod(int proxyMethod);
+
+    void setFilter(String filter);
+
+    void setRuntimeInterface(Class clazz);
+}

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableValueMetadata.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableValueMetadata.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableValueMetadata.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/mutable/MutableValueMetadata.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,34 @@
+/**
+ * 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.aries.blueprint.mutable;
+
+import org.osgi.service.blueprint.reflect.ValueMetadata;
+
+/**
+ * A mutable version of the <code>ValueMetadata</code> that allows modifications.
+ *
+ * @version $Rev: 896324 $, $Date: 2010-01-06 06:05:04 +0000 (Wed, 06 Jan 2010) $
+ */
+public interface MutableValueMetadata extends ValueMetadata {
+
+    void setStringValue(String stringValue);
+
+    void setType(String type);
+
+}

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/ComponentDefinitionRegistryImpl.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/ComponentDefinitionRegistryImpl.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/ComponentDefinitionRegistryImpl.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/ComponentDefinitionRegistryImpl.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,135 @@
+/*
+ * 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.aries.blueprint.namespace;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import org.apache.aries.blueprint.ComponentDefinitionRegistry;
+import org.apache.aries.blueprint.ComponentNameAlreadyInUseException;
+import org.apache.aries.blueprint.Interceptor;
+import org.apache.aries.blueprint.reflect.PassThroughMetadataImpl;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.Target;
+
+/**
+ * ComponentDefinitionRegistry implementation.
+ *
+ * This implementation uses concurrent lists and maps to store components and converters metadata
+ * to allow its use by concurrent threads. 
+ *
+ * @version $Rev: 1002318 $, $Date: 2010-09-28 19:47:49 +0100 (Tue, 28 Sep 2010) $
+ */
+public class ComponentDefinitionRegistryImpl implements ComponentDefinitionRegistry {
+
+    private final Map<String, ComponentMetadata> components;
+    private final List<Target> typeConverters;
+    private final Map<ComponentMetadata, List<Interceptor>> interceptors;
+
+    public ComponentDefinitionRegistryImpl() {
+        // Use a linked hash map to keep the declaration order 
+        components = Collections.synchronizedMap(new LinkedHashMap<String, ComponentMetadata>());
+        typeConverters = new CopyOnWriteArrayList<Target>();
+        interceptors = Collections.synchronizedMap(new HashMap<ComponentMetadata, List<Interceptor>>());
+    }
+
+    public void reset() {
+        components.clear();
+        typeConverters.clear();
+        interceptors.clear();
+    }
+
+    public boolean containsComponentDefinition(String name) {
+        return components.containsKey(name);
+    }
+
+    public ComponentMetadata getComponentDefinition(String name) {
+        return components.get(name);
+    }
+
+    public Set<String> getComponentDefinitionNames() {
+        return Collections.unmodifiableSet(components.keySet());
+    }
+
+    public void registerComponentDefinition(ComponentMetadata component) {
+        String id = component.getId();
+        if (id == null) {
+            // TODO: should we generate a unique name?
+            throw new IllegalArgumentException("Component must have a valid id");
+        }
+        if (id.startsWith("blueprint") && !(component instanceof PassThroughMetadataImpl)) {
+            // TODO: log a warning
+        }
+        // TODO: perform other validation: scope, class/runtimeClass/factoryMethod, etc...
+        if (components.containsKey(id)) {
+            throw new ComponentNameAlreadyInUseException(id);
+        }
+        components.put(id, component);
+    }
+
+    public void removeComponentDefinition(String name) {
+        ComponentMetadata removed = components.remove(name);
+        if(removed!=null){
+            interceptors.remove(removed);
+        }
+    }
+
+    public void registerTypeConverter(Target component) {
+        typeConverters.add(component);
+        if (component instanceof ComponentMetadata) {
+            registerComponentDefinition((ComponentMetadata) component);
+        }
+    }
+
+    public List<Target> getTypeConverters() {
+        return typeConverters;
+    }
+
+    public void registerInterceptorWithComponent(ComponentMetadata component, Interceptor interceptor) {
+        if(interceptor!=null){
+            List<Interceptor> componentInterceptorList = interceptors.get(component);
+            if(componentInterceptorList==null){
+                componentInterceptorList = new ArrayList<Interceptor>();
+                interceptors.put(component, componentInterceptorList);
+            }
+            if(!componentInterceptorList.contains(interceptor)){
+                componentInterceptorList.add(interceptor);
+                Collections.sort(componentInterceptorList, new Comparator<Interceptor>(){
+                    public int compare(Interceptor object1, Interceptor object2) {
+                        //invert the order so higher ranks are sorted 1st
+                        return object2.getRank() - object1.getRank();
+                    }
+                });
+            }
+        }
+    }
+
+    public List<Interceptor> getInterceptors(ComponentMetadata component) {
+        List<Interceptor> result = interceptors.get(component);
+        return (result == null) ? Collections.<Interceptor>emptyList() : result;
+    }
+    
+}

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,551 @@
+/*
+ * 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.aries.blueprint.namespace;
+
+import java.lang.ref.Reference;
+import java.lang.ref.SoftReference;
+import java.net.URI;
+import java.net.URL;
+import java.util.AbstractMap;
+import java.util.AbstractSet;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.HashSet;
+import java.io.IOException;
+
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.transform.Source;
+import javax.xml.XMLConstants;
+
+import org.apache.aries.blueprint.NamespaceHandler;
+import org.apache.aries.blueprint.container.NamespaceHandlerRegistry;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
+import org.osgi.util.tracker.ServiceTrackerCustomizer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xml.sax.SAXException;
+
+/**
+ * Default implementation of the NamespaceHandlerRegistry.
+ * 
+ * This registry will track NamespaceHandler objects in the OSGi registry and make
+ * them available, calling listeners when handlers are registered or unregistered.
+ *
+ * @version $Rev: 1071758 $, $Date: 2011-02-17 19:42:18 +0000 (Thu, 17 Feb 2011) $
+ */
+public class NamespaceHandlerRegistryImpl implements NamespaceHandlerRegistry, ServiceTrackerCustomizer {
+    
+    public static final URI BLUEPRINT_NAMESPACE = URI.create("http://www.osgi.org/xmlns/blueprint/v1.0.0");
+
+    public static final String NAMESPACE = "osgi.service.blueprint.namespace";
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(NamespaceHandlerRegistryImpl.class);
+
+    private final BundleContext bundleContext;
+    private final Map<URI, Set<NamespaceHandler>> handlers;
+    private final ServiceTracker tracker;
+    private final Map<Map<URI, NamespaceHandler>, Reference<Schema>> schemas = new LRUMap<Map<URI, NamespaceHandler>, Reference<Schema>>(10);
+    private SchemaFactory schemaFactory;
+    private List<NamespaceHandlerSetImpl> sets;
+
+    public NamespaceHandlerRegistryImpl(BundleContext bundleContext) {
+        this.bundleContext = bundleContext;
+        handlers = new HashMap<URI, Set<NamespaceHandler>>();
+        sets = new ArrayList<NamespaceHandlerSetImpl>();
+        tracker = new ServiceTracker(bundleContext, NamespaceHandler.class.getName(), this);
+        tracker.open();
+    }
+
+    public Object addingService(ServiceReference reference) {
+        LOGGER.debug("Adding NamespaceHandler "+reference.toString());
+        NamespaceHandler handler = (NamespaceHandler) bundleContext.getService(reference);
+        if(handler!=null){
+            try {
+                Map<String, Object> props = new HashMap<String, Object>();
+                for (String name : reference.getPropertyKeys()) {
+                    props.put(name, reference.getProperty(name));
+                }
+                registerHandler(handler, props);
+            } catch (Exception e) {
+                LOGGER.warn("Error registering NamespaceHandler", e);
+            }
+        }else{
+            LOGGER.warn("Error resolving NamespaceHandler, null Service obtained from tracked ServiceReference {} for bundle {}, ver {}", new Object[]{reference.toString(), reference.getBundle().getSymbolicName(), reference.getBundle().getVersion()});
+        }
+        return handler;
+    }
+
+    public void modifiedService(ServiceReference reference, Object service) {
+        removedService(reference, service);
+        addingService(reference);
+    }
+
+    public void removedService(ServiceReference reference, Object service) {
+        try {
+            NamespaceHandler handler = (NamespaceHandler) service;
+            Map<String, Object> props = new HashMap<String, Object>();
+            for (String name : reference.getPropertyKeys()) {
+                props.put(name, reference.getProperty(name));
+            }
+            unregisterHandler(handler, props);
+        } catch (Exception e) {
+            LOGGER.warn("Error unregistering NamespaceHandler", e);
+        }
+    }
+
+    public synchronized void registerHandler(NamespaceHandler handler, Map properties) {
+        List<URI> namespaces = getNamespaces(properties);
+        for (URI uri : namespaces) {
+            Set<NamespaceHandler> h = handlers.get(uri);
+            if (h == null) {
+                h = new HashSet<NamespaceHandler>();
+                handlers.put(uri, h);
+            }
+            if (h.add(handler)) {
+                for (NamespaceHandlerSetImpl s : sets) {
+                    s.registerHandler(uri, handler);
+                }
+            }
+        }
+    }
+
+    public synchronized void unregisterHandler(NamespaceHandler handler, Map properties) {
+        List<URI> namespaces = getNamespaces(properties);
+        for (URI uri : namespaces) {
+            Set<NamespaceHandler> h = handlers.get(uri);
+            if (h == null || !h.remove(handler)) {
+                continue;
+            }
+            for (NamespaceHandlerSetImpl s : sets) {
+                s.unregisterHandler(uri, handler);
+            }
+        }
+        removeSchemasFor(handler);
+    }
+
+    private static List<URI> getNamespaces(Map properties) {
+        Object ns = properties != null ? properties.get(NAMESPACE) : null;
+        if (ns == null) {
+            throw new IllegalArgumentException("NamespaceHandler service does not have an associated " + NAMESPACE + " property defined");
+        } else if (ns instanceof URI[]) {
+            return Arrays.asList((URI[]) ns);
+        } else if (ns instanceof URI) {
+            return Collections.singletonList((URI) ns);
+        } else if (ns instanceof String) {
+            return Collections.singletonList(URI.create((String) ns));
+        } else if (ns instanceof String[]) {
+            String[] strings = (String[]) ns;
+            List<URI> namespaces = new ArrayList<URI>(strings.length);
+            for (String string : strings) {
+                namespaces.add(URI.create(string));
+            }
+            return namespaces;
+        } else if (ns instanceof Collection) {
+            Collection col = (Collection) ns;
+            List<URI> namespaces = new ArrayList<URI>(col.size());
+            for (Object o : col) {
+                namespaces.add(toURI(o));
+            }
+            return namespaces;
+        } else if (ns instanceof Object[]) {
+            Object[] array = (Object[]) ns;
+            List<URI> namespaces = new ArrayList<URI>(array.length);
+            for (Object o : array) {
+                namespaces.add(toURI(o));
+            }
+            return namespaces;
+        } else {
+            throw new IllegalArgumentException("NamespaceHandler service has an associated " + NAMESPACE + " property defined which can not be converted to an array of URI");
+        }
+    }
+
+    private static URI toURI(Object o) {
+        if (o instanceof URI) {
+            return (URI) o;
+        } else if (o instanceof String) {
+            return URI.create((String) o);
+        } else {
+            throw new IllegalArgumentException("NamespaceHandler service has an associated " + NAMESPACE + " property defined which can not be converted to an array of URI");
+        }
+    }
+    
+    public synchronized NamespaceHandlerSet getNamespaceHandlers(Set<URI> uris, Bundle bundle) {
+        NamespaceHandlerSetImpl s = new NamespaceHandlerSetImpl(uris, bundle);
+        sets.add(s);
+        return s;
+    }
+
+    public void destroy() {
+        tracker.close();
+    }
+
+    public synchronized Schema getSchema(Map<URI, NamespaceHandler> handlers) throws IOException, SAXException {
+        Schema schema = null;
+        // Find a schema that can handle all the requested namespaces
+        // If it contains additional namespaces, it should not be a problem since
+        // they won't be used at all
+        for (Map<URI, NamespaceHandler> key : schemas.keySet()) {
+            boolean found = true;
+            for (URI uri : handlers.keySet()) {
+                if (!handlers.get(uri).equals(key.get(uri))) {
+                    found = false;
+                    break;
+                }
+            }
+            if (found) {
+                schema = schemas.get(key).get();
+                break;
+            }
+        }
+        if (schema == null) {
+            List<StreamSource> schemaSources = new ArrayList<StreamSource>();
+            try {
+                schemaSources.add(new StreamSource(getClass().getResourceAsStream("/org/apache/aries/blueprint/blueprint.xsd")));
+                // Create a schema for all namespaces known at this point
+                // It will speed things as it can be reused for all other blueprint containers
+                for (URI ns : handlers.keySet()) {
+                    URL url = handlers.get(ns).getSchemaLocation(ns.toString());
+                    if (url == null) {
+                        LOGGER.warn("No URL is defined for schema " + ns + ". This schema will not be validated");
+                    } else {
+                        schemaSources.add(new StreamSource(url.openStream()));
+                    }
+                }
+                schema = getSchemaFactory().newSchema(schemaSources.toArray(new Source[schemaSources.size()]));
+                // Remove schemas that are fully included
+                for (Iterator<Map<URI, NamespaceHandler>> iterator = schemas.keySet().iterator(); iterator.hasNext();) {
+                    Map<URI, NamespaceHandler> key = iterator.next();
+                    boolean found = true;
+                    for (URI uri : key.keySet()) {
+                        if (!key.get(uri).equals(handlers.get(uri))) {
+                            found = false;
+                            break;
+                        }
+                    }
+                    if (found) {
+                        iterator.remove();
+                        break;
+                    }
+                }
+                // Add our new schema
+                schemas.put(handlers, new SoftReference<Schema>(schema));
+            } finally {
+                for (StreamSource s : schemaSources) {
+                    try {
+                        s.getInputStream().close();
+                    } catch (IOException e) {
+                        // Ignore
+                    }
+                }
+            }
+        }
+        return schema;
+    }
+
+    protected synchronized void removeSchemasFor(NamespaceHandler handler) {
+        List<Map<URI, NamespaceHandler>> keys = new ArrayList<Map<URI, NamespaceHandler>>();
+        for (Map<URI, NamespaceHandler> key : schemas.keySet()) {
+            if (key.values().contains(handler)) {
+                keys.add(key);
+            }
+        }
+        for (Map<URI, NamespaceHandler> key : keys) {
+            schemas.remove(key);
+        }
+    }
+
+    private SchemaFactory getSchemaFactory() {
+        SchemaFactory schemaFactory = null;
+        if (schemaFactory == null) {
+            schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+        }
+        return schemaFactory;
+    }
+
+    protected class NamespaceHandlerSetImpl implements NamespaceHandlerSet {
+
+        private final Map<Listener, Boolean> listeners;
+        private final Bundle bundle;
+        private final Set<URI> namespaces;
+        private final Map<URI, NamespaceHandler> handlers;
+        private Schema schema;
+
+        public NamespaceHandlerSetImpl(Set<URI> namespaces, Bundle bundle) {
+            this.listeners = new HashMap<Listener, Boolean>();
+            this.namespaces = namespaces;
+            this.bundle = bundle;
+            handlers = new HashMap<URI, NamespaceHandler>();
+            for (URI ns : namespaces) {
+                findCompatibleNamespaceHandler(ns);
+            }
+        }
+
+        public boolean isComplete() {
+            return handlers.size() == namespaces.size();
+        }
+
+        public Set<URI> getNamespaces() {
+            return namespaces;
+        }
+
+        public NamespaceHandler getNamespaceHandler(URI namespace) {
+            return handlers.get(namespace);
+        }
+
+        public Schema getSchema() throws SAXException, IOException {
+            if (!isComplete()) {
+                throw new IllegalStateException("NamespaceHandlerSet is not complete");
+            }
+            if (schema == null) {
+                schema = NamespaceHandlerRegistryImpl.this.getSchema(handlers);
+            }
+            return schema;
+        }
+
+        public synchronized void addListener(Listener listener) {
+            listeners.put(listener, Boolean.TRUE);
+        }
+
+        public synchronized void removeListener(Listener listener) {
+            listeners.remove(listener);
+        }
+
+        public void destroy() {
+            NamespaceHandlerRegistryImpl.this.sets.remove(this);
+        }
+
+        public void registerHandler(URI uri, NamespaceHandler handler) {
+            if (namespaces.contains(uri) && handlers.get(uri) == null) {
+                if (findCompatibleNamespaceHandler(uri) !=  null) {
+                    for (Listener listener : listeners.keySet()) {
+                        try {
+                            listener.namespaceHandlerRegistered(uri);
+                        } catch (Throwable t) {
+                            LOGGER.debug("Unexpected exception when notifying a NamespaceHandler listener", t);
+                        }
+                    }
+                }
+            }
+        }
+
+        public void unregisterHandler(URI uri, NamespaceHandler handler) {
+            if (handlers.get(uri) == handler) {
+                handlers.remove(uri);
+                for (Listener listener : listeners.keySet()) {
+                    try {
+                        listener.namespaceHandlerUnregistered(uri);
+                    } catch (Throwable t) {
+                        LOGGER.debug("Unexpected exception when notifying a NamespaceHandler listener", t);
+                    }
+                }
+            }
+        }
+
+        private NamespaceHandler findCompatibleNamespaceHandler(URI ns) {
+            Set<NamespaceHandler> candidates = NamespaceHandlerRegistryImpl.this.handlers.get(ns);
+            if (candidates != null) {
+                for (NamespaceHandler h : candidates) {
+                    Set<Class> classes = h.getManagedClasses();
+                    boolean compat = true;
+                    if (classes != null) {
+                        Set<Class> allClasses = new HashSet<Class>();
+                        for (Class cl : classes) {
+                            for (Class c = cl; c != null; c = c.getSuperclass()) {
+                                allClasses.add(c);
+                                for (Class i : c.getInterfaces()) {
+                                    allClasses.add(i);
+                                }
+                            }
+                        }
+                        for (Class cl : allClasses) {
+                            Class clb;
+                            try {
+                                clb = bundle.loadClass(cl.getName());
+                                if (clb != cl) {
+                                    compat = false;
+                                    break;
+                                }
+                            } catch (ClassNotFoundException e) {
+                                // Ignore
+                            } catch (NoClassDefFoundError e) {
+                                // Ignore
+                            }
+                        }
+                    }
+                    if (compat) {
+                        handlers.put(ns, h);
+                        return h;
+                    }
+                }
+            }
+            return null;
+        }
+    }
+
+    protected static Map<URI, NamespaceHandler> findHandlers(Map<URI, Set<NamespaceHandler>> allHandlers,
+                                                             Set<URI> namespaces,
+                                                             Bundle bundle) {
+        Map<URI, NamespaceHandler> handlers = new HashMap<URI, NamespaceHandler>();
+        Map<URI, Set<NamespaceHandler>> candidates = new HashMap<URI, Set<NamespaceHandler>>();
+        // Populate initial candidates
+        for (URI ns : namespaces) {
+            Set<NamespaceHandler> h = new HashSet<NamespaceHandler>();
+            if (allHandlers.get(ns) != null) {
+                h.addAll(allHandlers.get(ns));
+            }
+            candidates.put(ns, h);
+        }
+        // Exclude directly incompatible handlers
+        for (URI ns : namespaces) {
+            for (Iterator<NamespaceHandler> it = candidates.get(ns).iterator(); it.hasNext();) {
+                NamespaceHandler h = it.next();
+                Set<Class> classes = h.getManagedClasses();
+                boolean compat = true;
+                if (classes != null) {
+                    Set<Class> allClasses = new HashSet<Class>();
+                    for (Class cl : classes) {
+                        for (Class c = cl; c != null; c = c.getSuperclass()) {
+                            allClasses.add(c);
+                            for (Class i : c.getInterfaces()) {
+                                allClasses.add(i);
+                            }
+                        }
+                    }
+                    for (Class cl : allClasses) {
+                        Class clb;
+                        try {
+                            clb = bundle.loadClass(cl.getName());
+                        } catch (Throwable t) {
+                            clb = null;
+                        }
+                        if (clb != cl) {
+                            compat = false;
+                            break;
+                        }
+                    }
+                }
+                if (!compat) {
+                    it.remove();
+                }
+            }
+        }
+        // TODO: do we need to check if there are incompatibilities between namespaces?
+        // Pick the first ones
+        for (URI ns : namespaces) {
+            Set<NamespaceHandler> h = candidates.get(ns);
+            if (!h.isEmpty()) {
+                handlers.put(ns, h.iterator().next());
+            }
+        }
+        return handlers;
+    }
+
+    public static class LRUMap<K,V> extends AbstractMap<K,V> {
+
+        private final int bound;
+        private final LinkedList<Entry<K,V>> entries = new LinkedList<Entry<K,V>>();
+
+        private static class LRUEntry<K,V> implements Entry<K,V> {
+            private final K key;
+            private final V value;
+
+            private LRUEntry(K key, V value) {
+                this.key = key;
+                this.value = value;
+            }
+
+            public K getKey() {
+                return key;
+            }
+
+            public V getValue() {
+                return value;
+            }
+
+            public V setValue(V value) {
+                throw new UnsupportedOperationException();
+            }
+        }
+
+        private LRUMap(int bound) {
+            this.bound = bound;
+        }
+
+        public V get(Object key) {
+            if (key == null) {
+                throw new NullPointerException();
+            }
+            for (Entry<K,V> e : entries) {
+                if (e.getKey().equals(key)) {
+                    entries.remove(e);
+                    entries.addFirst(e);
+                    return e.getValue();
+                }
+            }
+            return null;
+        }
+
+        public V put(K key, V value) {
+            if (key == null) {
+                throw new NullPointerException();
+            }
+            V old = null;
+            for (Entry<K,V> e : entries) {
+                if (e.getKey().equals(key)) {
+                    entries.remove(e);
+                    old = e.getValue();
+                    break;
+                }
+            }
+            if (value != null) {
+                entries.addFirst(new LRUEntry<K,V>(key, value));
+                while (entries.size() > bound) {
+                    entries.removeLast();
+                }
+            }
+            return old;
+        }
+
+        public Set<Entry<K, V>> entrySet() {
+            return new AbstractSet<Entry<K,V>>() {
+                public Iterator<Entry<K, V>> iterator() {
+                    return entries.iterator();
+                }
+
+                public int size() {
+                    return entries.size();
+                }
+            };
+        }
+    }
+
+}

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/proxy/Collaborator.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/proxy/Collaborator.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/proxy/Collaborator.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/proxy/Collaborator.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,232 @@
+/*
+ * 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.aries.blueprint.proxy;
+
+import java.io.Serializable;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Stack;
+
+import org.apache.aries.blueprint.Interceptor;
+import org.apache.aries.proxy.InvocationHandlerWrapper;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A collaborator which ensures preInvoke and postInvoke occur before and after
+ * method invocation
+ */
+public class Collaborator implements InvocationHandlerWrapper, Serializable {
+
+    /** Serial version UID for this class */
+    private static final long serialVersionUID = -58189302118314469L;
+
+    private static final Logger LOGGER = LoggerFactory
+            .getLogger(Collaborator.class);
+
+    private transient List<Interceptor> interceptors = null;
+    private transient ComponentMetadata cm = null;
+
+    public Collaborator(ComponentMetadata cm, List<Interceptor> interceptors) {
+        this.cm = cm;
+        this.interceptors = interceptors;
+    }
+
+    /**
+     * Invoke the preCall method on the interceptor
+     * 
+     * @param cm
+     *            : component Metadata
+     * @param m
+     *            : method
+     * @param parameters
+     *            : method paramters
+     * @throws Throwable
+     */
+    private void preCallInterceptor(List<Interceptor> interceptorList,
+            ComponentMetadata cm, Method m, Object[] parameters,
+            Stack<Collaborator.StackElement> calledInterceptors)
+            throws Throwable {
+        if ((interceptors != null) && !(interceptors.isEmpty())) {
+            for (Interceptor im : interceptorList) {
+                Collaborator.StackElement se = new StackElement(im);
+
+                // should we do this before or after the preCall ?
+                calledInterceptors.push(se);
+
+                // allow exceptions to propagate
+                se.setPreCallToken(im.preCall(cm, m, parameters));
+            }
+        }
+    }
+
+    public Object invoke(Object proxy, Method method, Object[] args, InvocationHandler target)
+            throws Throwable {
+        Object toReturn = null;
+        
+        Stack<Collaborator.StackElement> calledInterceptors = new Stack<Collaborator.StackElement>();
+        boolean inInvoke = false;
+        try {
+            preCallInterceptor(interceptors, cm, method, args,
+                    calledInterceptors);
+            inInvoke = true;
+            toReturn = target.invoke(proxy, method, args);
+            inInvoke = false;
+            postCallInterceptorWithReturn(cm, method, toReturn,
+                    calledInterceptors);
+
+        } catch (Throwable e) {
+            // whether the the exception is an error is an application decision
+            LOGGER.debug("invoke", e);
+
+            // if we catch an exception we decide carefully which one to
+            // throw onwards
+            Throwable exceptionToRethrow = null;
+            // if the exception came from a precall or postcall interceptor
+            // we will rethrow it
+            // after we cycle through the rest of the interceptors using
+            // postCallInterceptorWithException
+            if (!inInvoke) {
+                exceptionToRethrow = e;
+            }
+            // if the exception didn't come from precall or postcall then it
+            // came from invoke
+            // we will rethrow this exception if it is not a runtime
+            // exception
+            else {
+                if (!(e instanceof RuntimeException)) {
+                    exceptionToRethrow = e;
+                }
+            }
+            try {
+                postCallInterceptorWithException(cm, method, e,
+                        calledInterceptors);
+            } catch (Exception f) {
+                // we caught an exception from
+                // postCallInterceptorWithException
+                // logger.catching("invoke", f);
+                // if we haven't already chosen an exception to rethrow then
+                // we will throw this exception
+                if (exceptionToRethrow == null) {
+                    exceptionToRethrow = f;
+                } else {
+                  LOGGER.warn("Discarding post-call with interceptor exception", f);
+                }
+            }
+            // if we made it this far without choosing an exception we
+            // should throw e
+            if (exceptionToRethrow == null) {
+                exceptionToRethrow = e;
+            } else if (exceptionToRethrow != e) {
+              LOGGER.warn("Discarding initial exception", e);
+            }
+            throw exceptionToRethrow;
+        }
+        return toReturn;
+    }
+
+    /**
+     * Called when the method is called and returned normally
+     * 
+     * @param cm
+     *            : component metadata
+     * @param method
+     *            : method
+     * @param returnType
+     *            : return type
+     * @throws Throwable
+     */
+    private void postCallInterceptorWithReturn(ComponentMetadata cm,
+            Method method, Object returnType,
+            Stack<Collaborator.StackElement> calledInterceptors)
+            throws Throwable {
+
+        while (!calledInterceptors.isEmpty()) {
+            Collaborator.StackElement se = calledInterceptors.pop();
+            try {
+                se.interceptor.postCallWithReturn(cm, method, returnType, se
+                        .getPreCallToken());
+            } catch (Throwable t) {
+                LOGGER.debug("postCallInterceptorWithReturn", t);
+                // propagate this to invoke ... further interceptors will be
+                // called via the postCallInterceptorWithException method
+                throw t;
+            }
+        } // end while
+    }
+
+    /**
+     * Called when the method is called and returned with an exception
+     * 
+     * @param cm
+     *            : component metadata
+     * @param method
+     *            : method
+     * @param exception
+     *            : exception thrown
+     */
+    private void postCallInterceptorWithException(ComponentMetadata cm,
+            Method method, Throwable exception,
+            Stack<Collaborator.StackElement> calledInterceptors)
+            throws Throwable {
+        Throwable tobeRethrown = null;
+        while (!calledInterceptors.isEmpty()) {
+            Collaborator.StackElement se = calledInterceptors.pop();
+
+            try {
+                se.interceptor.postCallWithException(cm, method, exception, se
+                        .getPreCallToken());
+            } catch (Throwable t) {
+                // log the exception
+                LOGGER.debug("postCallInterceptorWithException", t);
+                if (tobeRethrown == null) {
+                    tobeRethrown = t;
+                } else {
+                  LOGGER.warn("Discarding post-call with interceptor exception", t);
+                }
+            }
+
+        } // end while
+
+        if (tobeRethrown != null)
+            throw tobeRethrown;
+    }
+
+    // info to store on interceptor stack during invoke
+    private static class StackElement {
+        private final Interceptor interceptor;
+        private Object preCallToken;
+
+        private StackElement(Interceptor i) {
+            interceptor = i;
+        }
+
+        private void setPreCallToken(Object preCallToken) {
+            this.preCallToken = preCallToken;
+        }
+
+        private Object getPreCallToken() {
+            return preCallToken;
+        }
+
+    }
+
+}
\ No newline at end of file

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/proxy/ProxyUtils.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/proxy/ProxyUtils.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/proxy/ProxyUtils.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/proxy/ProxyUtils.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,50 @@
+/**
+ * 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.aries.blueprint.proxy;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Callable;
+
+public class ProxyUtils 
+{
+  public static final Callable<Object> passThrough(final Object target)
+  {
+    return new Callable<Object>() {
+      public Object call() throws Exception {
+        return target;
+      }
+    };
+  }
+  
+  public static final List<Class<?>> asList(Class<?> ... classesArray)
+  {
+    List<Class<?>> classes = new ArrayList<Class<?>>();
+    for (Class<?> clazz : classesArray) {
+      classes.add(clazz);
+    }
+    return classes;
+  }
+  public static final List<Class<?>> asList(Class<?> clazz)
+  {
+    List<Class<?>> classes = new ArrayList<Class<?>>();
+    classes.add(clazz);
+    return classes;
+  }
+}

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/BeanArgumentImpl.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/BeanArgumentImpl.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/BeanArgumentImpl.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/BeanArgumentImpl.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,83 @@
+/*
+ * 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.aries.blueprint.reflect;
+
+import org.apache.aries.blueprint.mutable.MutableBeanArgument;
+import org.osgi.service.blueprint.reflect.BeanArgument;
+import org.osgi.service.blueprint.reflect.Metadata;
+
+/**
+ * Implementation of BeanArgument
+ *
+ * @version $Rev: 896324 $, $Date: 2010-01-06 06:05:04 +0000 (Wed, 06 Jan 2010) $
+ */
+public class BeanArgumentImpl implements MutableBeanArgument {
+
+    private Metadata value;
+    private String valueType;
+    private int index = -1;
+
+    public BeanArgumentImpl() {
+    }
+
+    public BeanArgumentImpl(Metadata value, String valueType, int index) {
+        this.value = value;
+        this.valueType = valueType;
+        this.index = index;
+    }
+
+    public BeanArgumentImpl(BeanArgument source) {
+        value = MetadataUtil.cloneMetadata(source.getValue());
+        valueType = source.getValueType();
+        index = source.getIndex();
+    }
+
+    public Metadata getValue() {
+        return value;
+    }
+
+    public void setValue(Metadata value) {
+        this.value = value;
+    }
+
+    public String getValueType() {
+        return valueType;
+    }
+
+    public void setValueType(String valueType) {
+        this.valueType = valueType;
+    }
+
+    public int getIndex() {
+        return index;
+    }
+
+    public void setIndex(int index) {
+        this.index = index;
+    }
+
+    @Override
+    public String toString() {
+        return "BeanArgument[" +
+                "value=" + value +
+                ", valueType='" + valueType + '\'' +
+                ", index=" + index +
+                ']';
+    }
+}

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/BeanMetadataImpl.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/BeanMetadataImpl.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/BeanMetadataImpl.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/BeanMetadataImpl.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,233 @@
+/*
+ * 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.aries.blueprint.reflect;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.aries.blueprint.ExtendedBeanMetadata;
+import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
+import org.osgi.service.blueprint.reflect.BeanArgument;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
+import org.osgi.service.blueprint.reflect.BeanProperty;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.osgi.service.blueprint.reflect.Target;
+
+/**
+ * Implementation of BeanMetadata
+ *
+ * @version $Rev: 910448 $, $Date: 2010-02-16 09:50:18 +0000 (Tue, 16 Feb 2010) $
+ */
+public class BeanMetadataImpl extends ComponentMetadataImpl implements MutableBeanMetadata {
+
+    private String className;
+    private String initMethod;
+    private String destroyMethod;
+    private List<BeanArgument> arguments;
+    private List<BeanProperty> properties;
+    private int initialization;
+    private String factoryMethod;
+    private Target factoryComponent;
+    private String scope;
+    private Class runtimeClass;
+    private boolean processor;
+    private boolean fieldInjection;
+    
+    public BeanMetadataImpl() {
+        this.fieldInjection = false;
+    }
+
+    public BeanMetadataImpl(BeanMetadata source) {
+        super(source);
+        this.className = source.getClassName();
+        this.initMethod = source.getInitMethod();
+        this.destroyMethod = source.getDestroyMethod();
+        for (BeanArgument argument : source.getArguments()) {
+            addArgument(new BeanArgumentImpl(argument));
+        }
+        for (BeanProperty property : source.getProperties()) {
+            addProperty(new BeanPropertyImpl(property));
+        }
+        this.initialization = source.getActivation();
+        this.factoryMethod = source.getFactoryMethod();
+        this.factoryComponent = MetadataUtil.cloneTarget(source.getFactoryComponent());
+        this.scope = source.getScope();
+        this.dependsOn = new ArrayList<String>(source.getDependsOn());
+        if (source instanceof ExtendedBeanMetadata) {
+            this.runtimeClass = ((ExtendedBeanMetadata) source).getRuntimeClass();
+            this.fieldInjection = ((ExtendedBeanMetadata) source).getFieldInjection();
+        } else {
+            this.fieldInjection = false;
+        }
+    }
+    
+    public String getClassName() {
+        return className;
+    }
+
+    public void setClassName(String className) {
+        this.className = className;
+    }
+
+    public String getInitMethod() {
+        return initMethod;
+    }
+
+    public void setInitMethod(String initMethodName) {
+        this.initMethod = initMethodName;
+    }
+
+    public String getDestroyMethod() {
+        return destroyMethod;
+    }
+
+    public void setDestroyMethod(String destroyMethodName) {
+        this.destroyMethod = destroyMethodName;
+    }
+
+    public List<BeanArgument> getArguments() {
+        if (this.arguments == null) {
+            return Collections.emptyList();
+        } else {
+            return Collections.unmodifiableList(this.arguments);
+        }
+    }
+
+    public void setArguments(List<BeanArgument> arguments) {
+        this.arguments = arguments != null ? new ArrayList<BeanArgument>(arguments) : null;
+    }
+
+    public void addArgument(BeanArgument argument) {
+        if (this.arguments == null) {
+            this.arguments = new ArrayList<BeanArgument>();
+        }
+        this.arguments.add(argument);
+    }
+
+    public BeanArgument addArgument(Metadata value, String valueType, int index) {
+        BeanArgument arg = new BeanArgumentImpl(value, valueType, index);
+        addArgument(arg);
+        return arg;
+    }
+
+    public void removeArgument(BeanArgument argument) {
+        if (this.arguments != null) {
+            this.arguments.remove(argument);
+        }
+    }
+
+    public List<BeanProperty> getProperties() {
+        if (this.properties == null) {
+            return Collections.emptyList();
+        } else {
+            return Collections.unmodifiableList(this.properties);
+        }
+    }
+
+    public void setProperties(List<BeanProperty> properties) {
+        this.properties = properties != null ? new ArrayList<BeanProperty>(properties) : null;
+    }
+
+    public void addProperty(BeanProperty property) {
+        if (this.properties == null) {
+            this.properties = new ArrayList<BeanProperty>();
+        }
+        this.properties.add(property);
+    }
+
+    public BeanProperty addProperty(String name, Metadata value) {
+        BeanProperty prop = new BeanPropertyImpl(name, value);
+        addProperty(prop);
+        return prop;
+    }
+
+    public void removeProperty(BeanProperty property) {
+        if (this.properties != null) {
+            this.properties.remove(property);
+        }
+    }
+
+    public String getFactoryMethod() {
+        return this.factoryMethod;
+    }
+
+    public void setFactoryMethod(String factoryMethodName) {
+        this.factoryMethod = factoryMethodName;
+    }
+
+    public Target getFactoryComponent() {
+        return this.factoryComponent;
+    }
+
+    public void setFactoryComponent(Target factoryComponent) {
+        this.factoryComponent = factoryComponent;
+    }
+
+    public String getScope() {
+        return this.scope;
+    }
+
+    public void setScope(String scope) {
+        this.scope = scope;
+    }
+
+    public Class getRuntimeClass() {
+        return this.runtimeClass;
+    }
+
+    public void setRuntimeClass(Class runtimeClass) {
+        this.runtimeClass = runtimeClass;
+    }
+
+    public boolean isProcessor() {
+        return processor;
+    }
+
+    public void setProcessor(boolean processor) {
+        this.processor = processor;
+    }
+
+    public boolean getFieldInjection() {
+        return fieldInjection;
+    }
+    
+    public void setFieldInjection(boolean fieldInjection) {
+        this.fieldInjection = fieldInjection;
+    }
+    
+    @Override
+    public String toString() {
+        return "BeanMetadata[" +
+                "id='" + id + '\'' +
+                ", initialization=" + initialization +
+                ", dependsOn=" + dependsOn +
+                ", className='" + className + '\'' +
+                ", initMethodName='" + initMethod + '\'' +
+                ", destroyMethodName='" + destroyMethod + '\'' +
+                ", arguments=" + arguments +
+                ", properties=" + properties +
+                ", factoryMethodName='" + factoryMethod + '\'' +
+                ", factoryComponent=" + factoryComponent +
+                ", scope='" + scope + '\'' +
+                ", runtimeClass=" + runtimeClass +
+                ", fieldInjection=" + fieldInjection + 
+                ']';
+    }
+}

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/BeanPropertyImpl.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/BeanPropertyImpl.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/BeanPropertyImpl.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/BeanPropertyImpl.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,71 @@
+/*
+ * 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.aries.blueprint.reflect;
+
+import org.apache.aries.blueprint.mutable.MutableBeanProperty;
+import org.osgi.service.blueprint.reflect.BeanProperty;
+import org.osgi.service.blueprint.reflect.Metadata;
+
+/**
+ * Implementation of BeanProperty
+ *
+ * @version $Rev: 896324 $, $Date: 2010-01-06 06:05:04 +0000 (Wed, 06 Jan 2010) $
+ */
+public class BeanPropertyImpl implements MutableBeanProperty {
+
+    private String name;
+    private Metadata value;
+
+    public BeanPropertyImpl() {
+    }
+
+    public BeanPropertyImpl(String name, Metadata value) {
+        this.name = name;
+        this.value = value;
+    }
+
+    public BeanPropertyImpl(BeanProperty source) {
+        this.name = source.getName();
+        this.value = MetadataUtil.cloneMetadata(source.getValue());
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Metadata getValue() {
+        return value;
+    }
+
+    public void setValue(Metadata value) {
+        this.value = value;
+    }
+
+    @Override
+    public String toString() {
+        return "BeanProperty[" +
+                "name='" + name + '\'' +
+                ", value=" + value +
+                ']';
+    }
+}
\ No newline at end of file

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/CollectionMetadataImpl.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/CollectionMetadataImpl.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/CollectionMetadataImpl.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/CollectionMetadataImpl.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,106 @@
+/*
+ * 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.aries.blueprint.reflect;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.aries.blueprint.mutable.MutableCollectionMetadata;
+import org.osgi.service.blueprint.reflect.CollectionMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+
+/**
+ * Implementation of CollectionMetadata
+ *
+ * @version $Rev: 896324 $, $Date: 2010-01-06 06:05:04 +0000 (Wed, 06 Jan 2010) $
+ */
+public class CollectionMetadataImpl implements MutableCollectionMetadata {
+
+    private Class collectionClass;
+    private String valueType;
+    private List<Metadata> values;
+
+    public CollectionMetadataImpl() {
+    }
+
+    public CollectionMetadataImpl(Class collectionClass, String valueType, List<Metadata> values) {
+        this.collectionClass = collectionClass;
+        this.valueType = valueType;
+        this.values = values;
+    }
+    
+    public CollectionMetadataImpl(CollectionMetadata source) {
+        this.collectionClass = source.getCollectionClass();
+        this.valueType = source.getValueType();
+        for (Metadata value : source.getValues()) {
+            addValue(MetadataUtil.cloneMetadata(value));
+        }
+    }
+
+    public Class getCollectionClass() {
+        return collectionClass;
+    }
+
+    public void setCollectionClass(Class collectionClass) {
+        this.collectionClass = collectionClass;
+    }
+
+    public String getValueType() {
+        return valueType;
+    }
+
+    public void setValueType(String valueType) {
+        this.valueType = valueType;
+    }
+
+    public List<Metadata> getValues() {
+        if (this.values == null) {
+            return Collections.emptyList();
+        } else {
+            return Collections.unmodifiableList(this.values);
+        }
+    }
+
+    public void setValues(List<Metadata> values) {
+        this.values = values != null ? new ArrayList<Metadata>(values) : null;
+    }
+
+    public void addValue(Metadata value) {
+        if (this.values == null) {
+            this.values = new ArrayList<Metadata>();
+        }
+        this.values.add(value);
+    }
+
+    public void removeValue(Metadata value) {
+        if (this.values != null) {
+            this.values.remove(value);
+        }
+    }
+
+    @Override
+    public String toString() {
+        return "CollectionMetadata[" +
+                "collectionClass=" + collectionClass +
+                ", valueType='" + valueType + '\'' +
+                ", values=" + values +
+                ']';
+    }
+}

Added: aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/ComponentMetadataImpl.java
URL: http://svn.apache.org/viewvc/aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/ComponentMetadataImpl.java?rev=1075149&view=auto
==============================================================================
--- aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/ComponentMetadataImpl.java (added)
+++ aries/tags/blueprint-0.3.1/blueprint-core/src/main/java/org/apache/aries/blueprint/reflect/ComponentMetadataImpl.java Sun Feb 27 21:21:05 2011
@@ -0,0 +1,88 @@
+/*
+ * 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.aries.blueprint.reflect;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.aries.blueprint.mutable.MutableComponentMetadata;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+
+/**
+ * Implementation of ComponentMetadata
+ *
+ * @version $Rev: 896324 $, $Date: 2010-01-06 06:05:04 +0000 (Wed, 06 Jan 2010) $
+ */
+public class ComponentMetadataImpl implements MutableComponentMetadata {
+
+    protected String id;
+    protected int activation = ACTIVATION_EAGER;
+    protected List<String> dependsOn;
+
+    protected ComponentMetadataImpl() {
+    }
+    
+    protected ComponentMetadataImpl(ComponentMetadata source) {
+        id = source.getId();
+        activation = source.getActivation();
+        dependsOn = new ArrayList<String>(source.getDependsOn());
+    }
+    
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public int getActivation() {
+        return activation;
+    }
+
+    public void setActivation(int activation) {
+        this.activation = activation;
+    }
+
+    public List<String> getDependsOn() {
+        if (this.dependsOn == null) {
+            return Collections.emptyList();
+        } else {
+            return Collections.unmodifiableList(this.dependsOn);
+        }
+    }
+
+    public void setDependsOn(List<String> dependsOn) {
+        this.dependsOn = dependsOn != null ? new ArrayList<String>(dependsOn) : null;
+    }
+
+    public void addDependsOn(String explicitDependency) {
+        if (this.dependsOn == null) {
+            this.dependsOn = new ArrayList<String>();
+        }
+        this.dependsOn.add(explicitDependency);
+    }
+
+    public void removeDependsOn(String dependency) {
+        if (this.dependsOn != null) {
+            this.dependsOn.remove(dependency);
+        }
+    }
+}



Mime
View raw message