You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by er...@apache.org on 2006/03/25 18:25:56 UTC
svn commit: r388786 [2/2] - in
/incubator/felix/trunk/org.apache.felix.servicebinder: ./ src/ src/main/
src/main/java/ src/main/java/org/ src/main/java/org/apache/
src/main/java/org/apache/felix/
src/main/java/org/apache/felix/servicebinder/ src/main/j...
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/InstanceReferenceListener.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/InstanceReferenceListener.java?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/InstanceReferenceListener.java (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/InstanceReferenceListener.java Sat Mar 25 09:25:49 2006
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.felix.servicebinder;
+
+/**
+ * This is an event listener for listening to changes in
+ * the availability of the underlying object associated
+ * with an <tt>InstanceReference</tt>. For the precise
+ * details of when this event is fired, refer to the
+ * methods below.
+ *
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+**/
+public interface InstanceReferenceListener extends java.util.EventListener
+{
+ /**
+ * This method is called when an <tt>InstanceReference</tt>'s
+ * underlying object becomes valid, i.e., the instance is
+ * available for use. This event is fired during the following
+ * sequence of steps:
+ * <p>
+ * <ol>
+ * <li>Instance created.</li>
+ * <li>Dependencies bound, if any.</li>
+ * <li>Services registered, if any.</li>
+ * <li><tt>Lifecycle.activate()</tt> is called, if the instance
+ * implements the <tt>Lifecycle</tt> interface.</li>
+ * <li>Fire <tt>InstanceReferenceListener.validated()</tt>.
+ * </ol>
+ * @param event the associated instance reference event.
+ **/
+ public void validated(InstanceReferenceEvent event);
+
+ /**
+ * This method is called when an <tt>InstanceReference</tt>'s
+ * underlying object is going to be invalidated. This event
+ * is fired during the following sequence of steps:
+ * <p>
+ * <ol>
+ * <li>Fire <tt>InstanceReferenceListener.invalidating()</tt>.
+ * <li>Call <tt>Lifecycle.deactivate()</tt>, if the instance
+ * implements the <tt>Lifecycle</tt> interface.</li>
+ * <li>Unregister services, if any.</li>
+ * <li>Unbind dependencies, if any.</li>
+ * <li>Dispose instance.</li>
+ * </ol>
+ * <p>
+ * Note: Care must be taken during this callback, because the
+ * underlying object associated with the instance reference may
+ * not be fully functioning. For example, this event might be
+ * fired in direct response to a dependent service shutting down,
+ * which then instigates the invalidation of the underlying object
+ * instance.
+ * @param event the associated instance reference event.
+ **/
+ public void invalidating(InstanceReferenceEvent event);
+}
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/InstanceReferenceListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/Lifecycle.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/Lifecycle.java?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/Lifecycle.java (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/Lifecycle.java Sat Mar 25 09:25:49 2006
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.felix.servicebinder;
+
+/**
+ * Instances created by the service binder, either via the
+ * <tt>GenericActivator</tt> or the <tt>GenericFactory</tt>,
+ * may implement this interface to receive notification of
+ * object life cycle events. See each interface method for
+ * a precise description of when the method is invoked.
+ *
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+**/
+public interface Lifecycle
+{
+ /**
+ * This method is called after the instance is created, all of its
+ * dependencies are valid, and all implemented services are registered.
+ **/
+ public void activate();
+
+ /**
+ * This method is called prior to instance disposal. At the time
+ * of invocation, all dependencies are still valid and all services
+ * are still registered. Be aware that at this point some dependent
+ * services may have been shutdown and using them may result in
+ * error conditions.
+ **/
+ public void deactivate();
+}
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/Lifecycle.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/PropertyMetadata.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/PropertyMetadata.java?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/PropertyMetadata.java (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/PropertyMetadata.java Sat Mar 25 09:25:49 2006
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.felix.servicebinder;
+
+/**
+ * A property descriptor that contains the information for properties
+ * defined in the meta-data file.
+ *
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ */
+public class PropertyMetadata
+{
+ String name;
+ String type;
+ Object value;
+
+ /**
+ * Create a PropertyMetadata object
+ *
+ * @param name the name of the property
+ * @param type the type of the property (string, boolean, byte, char, short, int, long, float or double)
+ * @param val the value of the property
+ */
+ public PropertyMetadata(String name, String type, String val)
+ {
+ this.name = name;
+ type.toLowerCase();
+ this.type = type;
+ value = null;
+
+ if(type.equals("string") || type.equals("String"))
+ {
+ value = new String(val);
+ }
+ else if(type.equals("boolean"))
+ {
+ value = new Boolean(val);
+ }
+ else if(type.equals("byte"))
+ {
+ value = new Byte(val);
+ }
+ else if(type.equals("char"))
+ {
+ value = new Byte(val);
+ }
+ else if(type.equals("short"))
+ {
+ value = new Short(val);
+ }
+ else if(type.equals("int"))
+ {
+ value = new Integer(val);
+ }
+ else if(type.equals("long"))
+ {
+ value = new Long(val);
+ }
+ else if(type.equals("float"))
+ {
+ value = new Float(val);
+ }
+ else if(type.equals("double"))
+ {
+ value = new Double(val);
+ }
+ }
+
+ /**
+ * Get the name of the property
+ *
+ * @return the name of the property
+ *
+ * @uml.property name="name"
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Get the type of the property
+ *
+ * @return the type of the property
+ *
+ * @uml.property name="type"
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Get the value of the property
+ *
+ * @return the value of the property as an Object
+ *
+ * @uml.property name="value"
+ */
+ public Object getValue() {
+ return value;
+ }
+}
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/ServiceBinderContext.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/ServiceBinderContext.java?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/ServiceBinderContext.java (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/ServiceBinderContext.java Sat Mar 25 09:25:49 2006
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.felix.servicebinder;
+
+import org.osgi.framework.BundleContext;
+
+import java.util.List;
+
+/**
+ * The ServiceBinderContext is passed to the objects that implement the services
+ * if they implement a constructor that receives a reference of this type. Through
+ * this interface, they can access the BundleContext along with the list ob
+ * binder instances located on the same bundle.
+ *
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ */
+public interface ServiceBinderContext
+{
+ /**
+ *
+ *@return the Bundle Context of the bundle where the receiver of the context is located
+ **/
+ BundleContext getBundleContext();
+
+ /**
+ *
+ *
+ **/
+ List getInstanceReferences();
+
+ /**
+ *
+ *
+ **/
+ InstanceReference getInstanceReference();
+}
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/ServiceBinderContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/ServiceBinderException.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/ServiceBinderException.java?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/ServiceBinderException.java (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/ServiceBinderException.java Sat Mar 25 09:25:49 2006
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.felix.servicebinder;
+
+/**
+ * Exceptions thrown by the ServiceBinder.
+ *
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ */
+public class ServiceBinderException extends Exception
+{
+ private static final long serialVersionUID = 2819108687170297942L;
+
+ public ServiceBinderException(String msg)
+ {
+ super(msg);
+ }
+}
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/ServiceBinderException.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/XmlHandler.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/XmlHandler.java?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/XmlHandler.java (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/XmlHandler.java Sat Mar 25 09:25:49 2006
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.felix.servicebinder;
+
+import java.util.Properties;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.felix.servicebinder.parser.ParseException;
+
+/**
+ * Simple content handler that builds a list of service descriptors
+ *
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ */
+public class XmlHandler
+{
+ /**
+ *
+ * @uml.property name="parentDescriptor"
+ * @uml.associationEnd multiplicity="(0 1)"
+ */
+ private InstanceMetadata parentDescriptor = null;
+
+ /**
+ *
+ * @uml.property name="currentDescriptor"
+ * @uml.associationEnd multiplicity="(0 1)"
+ */
+ private InstanceMetadata currentDescriptor = null;
+
+ private List descriptors = new ArrayList();
+
+ XmlHandler()
+ {
+ }
+
+ /**
+ * Method called when a tag opens
+ *
+ * @param uri
+ * @param localName
+ * @param qName
+ * @param attrib
+ * @exception ParseException
+ **/
+ public void startElement(String uri,String localName,String qName,Properties attrib) throws ParseException
+ {
+ if (qName.equals("instance") || qName.equals("component"))
+ {
+ currentDescriptor = new InstanceMetadata(attrib.getProperty("class"),parentDescriptor);
+ descriptors.add(currentDescriptor);
+ }
+ if (qName.equals("service")) // will be deprecated
+ {
+ if(currentDescriptor == null)
+ {
+ return;
+ }
+ currentDescriptor.addInterface(attrib.getProperty("interface"));
+ }
+ if (qName.equals("provides"))
+ {
+ if(currentDescriptor == null)
+ {
+ return;
+ }
+ currentDescriptor.addInterface(attrib.getProperty("service"));
+ }
+ if (qName.equals("property"))
+ {
+
+ if(currentDescriptor == null)
+ {
+ return;
+ }
+ PropertyMetadata prop = new PropertyMetadata(attrib.getProperty("name"),
+ attrib.getProperty("type"),
+ attrib.getProperty("value"));
+ currentDescriptor.addProperty(prop);
+ }
+ if (qName.equals("requires"))
+ {
+ if(currentDescriptor == null)
+ {
+ return;
+ }
+
+ DependencyMetadata dd=new DependencyMetadata(attrib.getProperty("service"),
+ attrib.getProperty("cardinality"),attrib.getProperty("policy"),attrib.getProperty("filter"),
+ attrib.getProperty("bind-method"),attrib.getProperty("unbind-method"));
+
+ currentDescriptor.addDependency(dd);
+ }
+
+ if (qName.equals("instantiates"))
+ {
+ GenericActivator.error("ERROR: Version 1.1 does not support factories");
+ }
+
+ }
+
+ /**
+ * Method called when a tag closes
+ *
+ * @param uri
+ * @param localName
+ * @param qName
+ * @exception ParseException
+ */
+ public void endElement(java.lang.String uri,java.lang.String localName,java.lang.String qName) throws ParseException
+ {
+ if (qName.equals("instantiates") || qName.equals("component"))
+ {
+ currentDescriptor = parentDescriptor;
+ parentDescriptor = null;
+ }
+ }
+
+ /**
+ * Called to retrieve the service descriptors
+ *
+ * @return A list of service descriptors
+ */
+ List getInstanceMetadatas()
+ {
+ return descriptors;
+ }
+}
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/XmlHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/ArchitectureService.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/ArchitectureService.java?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/ArchitectureService.java (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/ArchitectureService.java Sat Mar 25 09:25:49 2006
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.felix.servicebinder.architecture;
+
+/**
+ *
+ * A service to provide an architectural vision of the instances created by the
+ * service binder
+ *
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ */
+public interface ArchitectureService
+{
+ /**
+ * Get a list of all the available instance references
+ *
+ * @return a List containing all of the instance references
+ **/
+ public Instance [] getInstances();
+
+ /**
+ * Add a service binder listener
+ *
+ * @param listener a ServiceBinderListener to add to the Architecture service
+ **/
+ public void addServiceBinderListener(ServiceBinderListener listener);
+
+ /**
+ * Remove a service binder listener
+ *
+ * @param listener the listener to be removed
+ **/
+ public void removeServiceBinderListener(ServiceBinderListener listener);
+}
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/ArchitectureService.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/Dependency.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/Dependency.java?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/Dependency.java (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/Dependency.java Sat Mar 25 09:25:49 2006
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.felix.servicebinder.architecture;
+
+import org.apache.felix.servicebinder.DependencyMetadata;
+
+/**
+ * Interface for a dependency
+ *
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ */
+public interface Dependency
+{
+ /**
+ * get the dependency state
+ *
+ * @return the state of the dependency
+ **/
+ public int getDependencyState();
+
+ /**
+ * get the dependency metadata
+ *
+ * @return the metadata of the dependency
+ **/
+ public DependencyMetadata getDependencyMetadata();
+
+ /**
+ * get the bound service objects
+ *
+ * @return the bound Instances
+ **/
+ public Instance []getBoundInstances();
+}
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/Dependency.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/DependencyChangeEvent.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/DependencyChangeEvent.java?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/DependencyChangeEvent.java (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/DependencyChangeEvent.java Sat Mar 25 09:25:49 2006
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.felix.servicebinder.architecture;
+
+import org.apache.felix.servicebinder.DependencyMetadata;
+
+/**
+ * An event thrown when a dependency changes
+ *
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ */
+public class DependencyChangeEvent
+{
+ public static final int DEPENDENCY_CREATED = 0;
+ public static final int DEPENDENCY_VALID = 1;
+ public static final int DEPENDENCY_INVALID = 2;
+ public static final int DEPENDENCY_DESTROYED = 3;
+
+ /**
+ *
+ * @uml.property name="m_dep"
+ * @uml.associationEnd multiplicity="(0 1)"
+ */
+ private Dependency m_dep;
+
+ /**
+ *
+ * @uml.property name="m_meta"
+ * @uml.associationEnd multiplicity="(0 1)"
+ */
+ private DependencyMetadata m_meta;
+
+ private int m_state;
+
+ public DependencyChangeEvent(Dependency dep, DependencyMetadata meta,int newState)
+ {
+ m_dep = dep;
+ m_meta = meta;
+ m_state = newState;
+ }
+
+ public Dependency getDependency()
+ {
+ return m_dep;
+ }
+
+ public DependencyMetadata getDependencyMetadata()
+ {
+ return m_meta;
+ }
+
+ public int getState()
+ {
+ return m_state;
+ }
+}
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/DependencyChangeEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/Instance.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/Instance.java?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/Instance.java (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/Instance.java Sat Mar 25 09:25:49 2006
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.felix.servicebinder.architecture;
+
+import org.apache.felix.servicebinder.InstanceMetadata;
+
+/**
+ *
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ */
+public interface Instance
+{
+ public static final int INSTANCE_CREATED = 0;
+ public static final int INSTANCE_VALID = 1;
+ public static final int INSTANCE_INVALID = 2;
+ public static final int INSTANCE_DESTROYED = 3;
+
+ /**
+ * Get the state of the instance
+ *
+ * @return an integer representing the state of the instance
+ **/
+ public int getState();
+
+ /**
+ * Get the bundle
+ *
+ * @return an integer with the bundle id
+ **/
+ public long getBundleId();
+
+ /**
+ * Get a list of depenencies
+ *
+ * @return a List containing all of the dependencies
+ **/
+ public Dependency[] getDependencies();
+
+ /**
+ * Get a list of child instances in case this instance is a factory
+ *
+ * @return a List containing all of the child instances
+ **/
+ public Instance[] getChildInstances();
+
+ /**
+ * Get the instance metadata
+ *
+ * @return the isntance metadata
+ **/
+ public InstanceMetadata getInstanceMetadata();
+}
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/Instance.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/InstanceChangeEvent.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/InstanceChangeEvent.java?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/InstanceChangeEvent.java (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/InstanceChangeEvent.java Sat Mar 25 09:25:49 2006
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.felix.servicebinder.architecture;
+
+import org.apache.felix.servicebinder.InstanceMetadata;
+
+/**
+ *
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ */
+public class InstanceChangeEvent
+{
+ /**
+ *
+ * @uml.property name="m_ref"
+ * @uml.associationEnd multiplicity="(0 1)"
+ */
+ private Instance m_ref;
+
+ /**
+ *
+ * @uml.property name="m_meta"
+ * @uml.associationEnd multiplicity="(0 1)"
+ */
+ private InstanceMetadata m_meta;
+
+ private int m_state;
+
+ public InstanceChangeEvent(Instance ref,InstanceMetadata meta,int state)
+ {
+ m_ref = ref;
+ m_meta = meta;
+ m_state = state;
+ }
+
+ public Instance getInstance()
+ {
+ return m_ref;
+ }
+
+ public InstanceMetadata getInstanceMetadata()
+ {
+ return m_meta;
+ }
+
+ public int getState()
+ {
+ return m_state;
+ }
+}
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/InstanceChangeEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/ServiceBinderListener.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/ServiceBinderListener.java?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/ServiceBinderListener.java (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/ServiceBinderListener.java Sat Mar 25 09:25:49 2006
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.felix.servicebinder.architecture;
+
+/**
+ * The ServiceBinderListener interface must be implemented by any subclass
+ * of the GenericActivator if it wishes to receive notifications about
+ * changes in the architecture
+ *
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ */
+public interface ServiceBinderListener extends java.util.EventListener
+{
+ /*
+ * Method called when an instance changes its state
+ */
+ void instanceReferenceChanged(InstanceChangeEvent evt);
+
+ /*
+ * Method called when a dependency changes its state
+ */
+ void dependencyChanged(DependencyChangeEvent evt);
+
+}
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/architecture/ServiceBinderListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/impl/Activator.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/impl/Activator.java?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/impl/Activator.java (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/impl/Activator.java Sat Mar 25 09:25:49 2006
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.felix.servicebinder.impl;
+
+import org.apache.felix.servicebinder.GenericActivator;
+
+/**
+ *
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ */
+public class Activator extends GenericActivator
+{
+}
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/impl/Activator.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/impl/ArchitectureEventMulticaster.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/impl/ArchitectureEventMulticaster.java?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/impl/ArchitectureEventMulticaster.java (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/impl/ArchitectureEventMulticaster.java Sat Mar 25 09:25:49 2006
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.felix.servicebinder.impl;
+
+import org.apache.felix.servicebinder.architecture.DependencyChangeEvent;
+import org.apache.felix.servicebinder.architecture.InstanceChangeEvent;
+import org.apache.felix.servicebinder.architecture.ServiceBinderListener;
+
+/**
+ *
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ */
+public class ArchitectureEventMulticaster implements ServiceBinderListener
+{
+ /**
+ *
+ * @uml.property name="a"
+ * @uml.associationEnd multiplicity="(0 1)"
+ */
+ protected ServiceBinderListener a;
+
+ /**
+ *
+ * @uml.property name="b"
+ * @uml.associationEnd multiplicity="(0 1)"
+ */
+ protected ServiceBinderListener b;
+
+ protected ArchitectureEventMulticaster(ServiceBinderListener a, ServiceBinderListener b)
+ {
+ this.a = a;
+ this.b = b;
+ }
+
+ public void dependencyChanged(DependencyChangeEvent e)
+ {
+ a.dependencyChanged(e);
+ b.dependencyChanged(e);
+ }
+
+ public void instanceReferenceChanged(InstanceChangeEvent e)
+ {
+ a.instanceReferenceChanged(e);
+ b.instanceReferenceChanged(e);
+ }
+
+ public static ServiceBinderListener add(ServiceBinderListener a, ServiceBinderListener b)
+ {
+ if (a == null)
+ return b;
+ else if (b == null)
+ return a;
+ else
+ return new ArchitectureEventMulticaster(a, b);
+ }
+
+ public static ServiceBinderListener remove(ServiceBinderListener a, ServiceBinderListener b)
+ {
+ if ((a == null) || (a == b))
+ return null;
+ else if (a instanceof ArchitectureEventMulticaster)
+ return add (remove (((ArchitectureEventMulticaster) a).a, b),remove (((ArchitectureEventMulticaster) a).b, b));
+ else
+ return a;
+ }
+}
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/impl/ArchitectureEventMulticaster.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/impl/ArchitectureServiceImpl.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/impl/ArchitectureServiceImpl.java?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/impl/ArchitectureServiceImpl.java (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/impl/ArchitectureServiceImpl.java Sat Mar 25 09:25:49 2006
@@ -0,0 +1,171 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.felix.servicebinder.impl;
+
+import org.apache.felix.servicebinder.InstanceReference;
+import org.apache.felix.servicebinder.Lifecycle;
+import org.apache.felix.servicebinder.architecture.ArchitectureService;
+import org.apache.felix.servicebinder.architecture.DependencyChangeEvent;
+import org.apache.felix.servicebinder.architecture.Instance;
+import org.apache.felix.servicebinder.architecture.InstanceChangeEvent;
+import org.apache.felix.servicebinder.architecture.ServiceBinderListener;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * Class that implements the architecture service
+ * an object of this class is created when the
+ * service binder bundle is activated
+ *
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ */
+public class ArchitectureServiceImpl implements ArchitectureService, Lifecycle
+{
+ /**
+ *
+ * @uml.property name="m_listeners"
+ * @uml.associationEnd multiplicity="(0 1)"
+ */
+ private ServiceBinderListener m_listeners = null;
+
+ /**
+ *
+ * @uml.property name="m_ref"
+ * @uml.associationEnd multiplicity="(0 1)"
+ */
+ private static ArchitectureServiceImpl m_ref = null;
+
+ private static List m_instanceReferences = new ArrayList();
+
+ public ArchitectureServiceImpl() throws Exception
+ {
+ if(m_ref == null)
+ {
+ m_ref = this;
+ }
+ }
+
+ public static InstanceReference findInstanceReference(Object obj)
+ {
+ Object[] refs=m_instanceReferences.toArray();
+
+ for(int i=0; i<refs.length ;i++)
+ {
+ InstanceReference current = (InstanceReference) refs [i];
+ if(current.getObject( )== obj)
+ {
+ return current;
+ }
+ }
+
+ return null;
+ }
+
+ public static void addInstanceReference(InstanceReference ref)
+ {
+ m_instanceReferences.add(ref);
+ }
+
+ public static void removeInstanceReference(InstanceReference ref)
+ {
+ m_instanceReferences.remove(ref);
+ }
+
+ public Instance[] getInstances()
+ {
+ Instance instances[]=new Instance[m_instanceReferences.size()];
+ instances = (Instance [])m_instanceReferences.toArray(instances);
+
+ return instances;
+ }
+
+ public static ArchitectureServiceImpl getReference()
+ {
+ return m_ref;
+ }
+
+ public void activate()
+ {
+ }
+
+ synchronized public void deactivate()
+ {
+ m_ref = null;
+ m_listeners = null; //new EventListenerList();
+ }
+
+ /**
+ * Add a service binder listener
+ **/
+ public void addServiceBinderListener(ServiceBinderListener listener)
+ {
+ //m_listeners.add(ServiceBinderListener.class, listener);
+ m_listeners = ArchitectureEventMulticaster.add(m_listeners, listener);
+ }
+
+ /**
+ * Remove a service binder listener
+ **/
+ public void removeServiceBinderListener(ServiceBinderListener listener)
+ {
+ //m_listeners.remove(ServiceBinderListener.class, listener);
+ m_listeners = ArchitectureEventMulticaster.remove(m_listeners, listener);
+ }
+
+ /**
+ * Fires an event when an instance has changed
+ **/
+ public void fireInstanceChangeEvent(InstanceChangeEvent evt)
+ {
+ try
+ {
+ if (m_listeners != null)
+ {
+ m_listeners.instanceReferenceChanged(evt);
+ }
+ }
+ catch(Exception ex)
+ {
+ // Ignore any exception
+ }
+ }
+
+ /**
+ * Fires an event when a dependency has changed
+ **/
+ public void fireDependencyChangeEvent(DependencyChangeEvent evt)
+ {
+ try
+ {
+ if (m_listeners != null)
+ {
+ m_listeners.dependencyChanged(evt);
+ }
+ }
+ catch(Exception ex)
+ {
+ // Ignore any exception
+ }
+ }
+
+
+
+}
+
+
+
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/impl/ArchitectureServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/parser/KxmlParser.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/parser/KxmlParser.java?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/parser/KxmlParser.java (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/parser/KxmlParser.java Sat Mar 25 09:25:49 2006
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.felix.servicebinder.parser;
+
+import org.apache.felix.servicebinder.XmlHandler;
+import org.kxml.parser.XmlParser;
+import org.kxml.parser.ParseEvent;
+import org.kxml.Xml;
+import org.kxml.Attribute;
+
+import java.io.Reader;
+
+import java.util.Properties;
+
+/**
+ * The KxmlParser extends the XmlParser from kxml. This is a very
+ * simple parser that does not take into account the DTD
+ *
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ */
+public class KxmlParser extends XmlParser
+{
+ /**
+ * The constructor for a parser, it receives a java.io.Reader.
+ *
+ * @param r The reader
+ * @exception java.io.IOException thrown by the superclass
+ */
+ public KxmlParser(Reader r) throws java.io.IOException
+ {
+ super(r);
+ }
+
+ /**
+ * Parser from the reader provided in the constructor, and call
+ * the startElement and endElement in a KxmlHandler
+ *
+ * @param handler The handler
+ * @exception java.io.IOException thrown by the superclass
+ */
+ public void parseXML(XmlHandler handler) throws java.io.IOException, ParseException
+ {
+ ParseEvent evt=null;
+ do
+ {
+ evt = read();
+ if (evt.getType() == Xml.START_TAG)
+ {
+ Properties props = new Properties();
+ for (int i=0; i<evt.getAttributeCount();i++)
+ {
+ Attribute attr = evt.getAttribute(i);
+ props.put(attr.getName(),attr.getValue());
+ }
+ handler.startElement("uri",evt.getName(),evt.getName(),props);
+ }
+ if (evt.getType() == Xml.END_TAG)
+ {
+ handler.endElement("uri",evt.getName(),evt.getName());
+ }
+ }while(evt.getType()!=Xml.END_DOCUMENT);
+ }
+}
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/parser/KxmlParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/parser/ParseException.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/parser/ParseException.java?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/parser/ParseException.java (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/parser/ParseException.java Sat Mar 25 09:25:49 2006
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.felix.servicebinder.parser;
+
+/**
+ * Exceptions thrown by the ServiceBinder.
+ *
+ * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
+ */
+public class ParseException extends Exception
+{
+ private static final long serialVersionUID = -2658823754557277056L;
+
+ public ParseException(String msg)
+ {
+ super(msg);
+ }
+}
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/java/org/apache/felix/servicebinder/parser/ParseException.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/resources/metadata.dtd
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/resources/metadata.dtd?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/resources/metadata.dtd (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/resources/metadata.dtd Sat Mar 25 09:25:49 2006
@@ -0,0 +1,29 @@
+<!--
+ DTD for org.apache.felix.servicebinder descriptor DTD
+ Version: 1.1
+-->
+
+<!ELEMENT bundle (component*)>
+<!ELEMENT component (property*,provides*,requires*)>
+ <!ATTLIST component
+ class CDATA #REQUIRED
+ >
+<!ELEMENT provides EMPTY>
+ <!ATTLIST provides
+ service CDATA #REQUIRED
+ >
+<!ELEMENT property EMPTY>
+ <!ATTLIST property
+ name CDATA #REQUIRED
+ type CDATA #REQUIRED
+ value CDATA #REQUIRED
+ >
+<!ELEMENT requires EMPTY>
+ <!ATTLIST requires
+ service CDATA #REQUIRED
+ filter CDATA #REQUIRED
+ cardinality (0..1|0..n|1..1|1..n) #REQUIRED
+ policy (static|dynamic) #REQUIRED
+ bind-method CDATA #REQUIRED
+ unbind-method CDATA #REQUIRED
+>
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/resources/metadata.dtd
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/resources/metadata.xml
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.servicebinder/src/main/resources/metadata.xml?rev=388786&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.servicebinder/src/main/resources/metadata.xml (added)
+++ incubator/felix/trunk/org.apache.felix.servicebinder/src/main/resources/metadata.xml Sat Mar 25 09:25:49 2006
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--<!DOCTYPE bundle SYSTEM "metadata.dtd">-->
+<bundle>
+ <component class="org.apache.felix.servicebinder.impl.ArchitectureServiceImpl">
+ <provides service="org.apache.felix.servicebinder.architecture.ArchitectureService"/>
+ </component>
+</bundle>
Propchange: incubator/felix/trunk/org.apache.felix.servicebinder/src/main/resources/metadata.xml
------------------------------------------------------------------------------
svn:eol-style = native