[jboss-cvs] JBossAS SVN: r59347 - in projects/osgi/trunk/deployment/src: main/org/jboss/osgi main/org/jboss/osgi/metadata main/org/jboss/osgi/metadata/plugins main/org/jboss/osgi/metadata/spi resources resources/schema
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jan 4 08:53:00 EST 2007
Author: alesj
Date: 2007-01-04 08:52:53 -0500 (Thu, 04 Jan 2007)
New Revision: 59347
Added:
projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/
projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/
projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractListenerMetaData.java
projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractOSGiMetaData.java
projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractReferenceMetaData.java
projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractServiceMetaData.java
projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/
projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/Cardinality.java
projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/ClassLoaderOptions.java
projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/ListenerMetaData.java
projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/OSGiMetaData.java
projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/ReferenceMetaData.java
projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/ServiceMetaData.java
projects/osgi/trunk/deployment/src/resources/schema/
projects/osgi/trunk/deployment/src/resources/schema/osgi-beans_1_0.xsd
Log:
initial metadata
Added: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractListenerMetaData.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractListenerMetaData.java 2007-01-04 13:33:58 UTC (rev 59346)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractListenerMetaData.java 2007-01-04 13:52:53 UTC (rev 59347)
@@ -0,0 +1,69 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.metadata.plugins;
+
+import org.jboss.osgi.metadata.spi.ListenerMetaData;
+
+/**
+ * Simple listener meta data.
+ * Referencing ref bean as a reference listener.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AbstractListenerMetaData implements ListenerMetaData
+{
+
+ private String ref;
+ private String bindMethod;
+ private String unbindMethod;
+
+ public String getRef()
+ {
+ return ref;
+ }
+
+ public String getBindMethod()
+ {
+ return bindMethod;
+ }
+
+ public String getUnbindMethod()
+ {
+ return unbindMethod;
+ }
+
+ public void setRef(String ref)
+ {
+ this.ref = ref;
+ }
+
+ public void setBindMethod(String bindMethod)
+ {
+ this.bindMethod = bindMethod;
+ }
+
+ public void setUnbindMethod(String unbindMethod)
+ {
+ this.unbindMethod = unbindMethod;
+ }
+
+}
Added: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractOSGiMetaData.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractOSGiMetaData.java 2007-01-04 13:33:58 UTC (rev 59346)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractOSGiMetaData.java 2007-01-04 13:52:53 UTC (rev 59347)
@@ -0,0 +1,85 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.metadata.plugins;
+
+import java.util.Set;
+
+import org.jboss.beans.metadata.plugins.AbstractFeatureMetaData;
+import org.jboss.beans.metadata.spi.ClassLoaderMetaData;
+import org.jboss.beans.metadata.spi.DependencyMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
+import org.jboss.osgi.metadata.spi.OSGiMetaData;
+
+/**
+ * Common OSGi reference or service impl.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractOSGiMetaData extends AbstractFeatureMetaData
+ implements OSGiMetaData, BeanMetaDataFactory
+{
+ private String id;
+ private String anInterface;
+ private Set<DependencyMetaData> depends;
+ private ClassLoaderMetaData classLoaderMetaData;
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public String getInterface()
+ {
+ return anInterface;
+ }
+
+ public Set<DependencyMetaData> getDepends()
+ {
+ return depends;
+ }
+
+ public ClassLoaderMetaData getContextClassLoader()
+ {
+ return classLoaderMetaData;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public void setInterface(String anInterface)
+ {
+ this.anInterface = anInterface;
+ }
+
+ public void setDepends(Set<DependencyMetaData> depends)
+ {
+ this.depends = depends;
+ }
+
+ public void setClassLoaderMetaData(ClassLoaderMetaData classLoaderMetaData)
+ {
+ this.classLoaderMetaData = classLoaderMetaData;
+ }
+
+}
Added: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractReferenceMetaData.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractReferenceMetaData.java 2007-01-04 13:33:58 UTC (rev 59346)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractReferenceMetaData.java 2007-01-04 13:52:53 UTC (rev 59347)
@@ -0,0 +1,119 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.metadata.plugins;
+
+import java.util.List;
+import java.util.Set;
+
+import org.jboss.beans.metadata.spi.*;
+import org.jboss.osgi.metadata.spi.Cardinality;
+import org.jboss.osgi.metadata.spi.ListenerMetaData;
+import org.jboss.osgi.metadata.spi.ReferenceMetaData;
+import org.jboss.reflect.spi.TypeInfo;
+
+/**
+ * OSGi reference meta data.
+ * Can be used as a value meta data - must return a proxy.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AbstractReferenceMetaData extends AbstractOSGiMetaData
+ implements ReferenceMetaData
+{
+ private String filter;
+ private Cardinality cardinality;
+ private Integer timeout;
+ private List<ListenerMetaData> listeners;
+ private Set<PropertyMetaData> properties;
+
+ public Object getUnderlyingValue()
+ {
+ return getId();
+ }
+
+ public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable
+ {
+ // todo - OSGi lookup + AOP wrap
+ return null;
+ }
+
+ public List<BeanMetaData> getBeans()
+ {
+ // todo - reference this + AOP bean
+ return null;
+ }
+
+ public String getFilter()
+ {
+ return filter;
+ }
+
+ public Cardinality getCardinality()
+ {
+ return cardinality;
+ }
+
+ public Integer getTimeout()
+ {
+ return timeout;
+ }
+
+ public List<ListenerMetaData> getListeners()
+ {
+ return listeners;
+ }
+
+ public Set<PropertyMetaData> getProperties()
+ {
+ return properties;
+ }
+
+ public Class getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable
+ {
+ return null;
+ }
+
+ public void setFilter(String filter)
+ {
+ this.filter = filter;
+ }
+
+ public void setCardinality(Cardinality cardinality)
+ {
+ this.cardinality = cardinality;
+ }
+
+ public void setTimeout(Integer timeout)
+ {
+ this.timeout = timeout;
+ }
+
+ public void setListeners(List<ListenerMetaData> listeners)
+ {
+ this.listeners = listeners;
+ }
+
+ public void setProperties(Set<PropertyMetaData> properties)
+ {
+ this.properties = properties;
+ }
+}
Added: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractServiceMetaData.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractServiceMetaData.java 2007-01-04 13:33:58 UTC (rev 59346)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/plugins/AbstractServiceMetaData.java 2007-01-04 13:52:53 UTC (rev 59347)
@@ -0,0 +1,114 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.metadata.plugins;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.MetaDataVisitor;
+import org.jboss.beans.metadata.spi.MetaDataVisitorNode;
+import org.jboss.dependency.plugins.AbstractDependencyItem;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.DependencyItem;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.osgi.metadata.spi.ServiceMetaData;
+
+/**
+ * OSGi service meta data.
+ * Register ref bean as an OSGi service with interface or interfaces.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AbstractServiceMetaData extends AbstractOSGiMetaData
+ implements ServiceMetaData
+{
+ private Set<String> interfaces;
+ private Map<String, String> serviceProperties;
+ private String ref;
+ private boolean lazyInit;
+
+ public List<BeanMetaData> getBeans()
+ {
+ // todo - register OSGi service + GUID name if id doesn't exist
+ return null;
+ }
+
+ public void initialVisit(MetaDataVisitor visitor)
+ {
+ KernelControllerContext controllerContext = visitor.getControllerContext();
+ Object name = controllerContext.getName();
+ Object iDependOn = getRef();
+ ControllerState whenRequired = visitor.getContextState();
+ DependencyItem item = new AbstractDependencyItem(name, iDependOn, whenRequired, ControllerState.INSTALLED);
+ visitor.addDependency(item);
+
+ super.initialVisit(visitor);
+ }
+
+ public Set<String> getInterfaces()
+ {
+ return interfaces;
+ }
+
+ public Map<String, String> getServiceProperties()
+ {
+ return serviceProperties;
+ }
+
+ public String getRef()
+ {
+ return ref;
+ }
+
+ public boolean getLazyInit()
+ {
+ return lazyInit;
+ }
+
+ public Class getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable
+ {
+ return null;
+ }
+
+ public void setInterfaces(Set<String> interfaces)
+ {
+ this.interfaces = interfaces;
+ }
+
+ public void setServiceProperties(Map<String, String> serviceProperties)
+ {
+ this.serviceProperties = serviceProperties;
+ }
+
+ public void setRef(String ref)
+ {
+ this.ref = ref;
+ }
+
+ public void setLazyInit(boolean lazyInit)
+ {
+ this.lazyInit = lazyInit;
+ }
+
+}
Added: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/Cardinality.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/Cardinality.java 2007-01-04 13:33:58 UTC (rev 59346)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/Cardinality.java 2007-01-04 13:52:53 UTC (rev 59347)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.metadata.spi;
+
+/**
+ * OSGi cardinality def.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public enum Cardinality
+{
+ ZERO_TO_ONE("0..1"),
+ ZERO_TO_MANY("0..n"),
+ ONE_TO_ONE("1..1"),
+ ONE_TO_MANY("1..n");
+
+ private String type;
+
+ Cardinality(String type)
+ {
+ this.type = type;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+}
Added: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/ClassLoaderOptions.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/ClassLoaderOptions.java 2007-01-04 13:33:58 UTC (rev 59346)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/ClassLoaderOptions.java 2007-01-04 13:52:53 UTC (rev 59347)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.metadata.spi;
+
+/**
+ * ClassLoader options.
+ * Defines the class loader when accessing references or services.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public enum ClassLoaderOptions
+{
+ CLIENT("client", false),
+ SERVICE_PROVIDER("service-provider", true),
+ UNMANAGED("unmanaged", true);
+
+ private String type;
+ private boolean serviceSupported;
+
+ ClassLoaderOptions(String type, boolean serviceSupported)
+ {
+ this.type = type;
+ this.serviceSupported = serviceSupported;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public boolean isServiceSupported()
+ {
+ return serviceSupported;
+ }
+
+}
Added: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/ListenerMetaData.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/ListenerMetaData.java 2007-01-04 13:33:58 UTC (rev 59346)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/ListenerMetaData.java 2007-01-04 13:52:53 UTC (rev 59347)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.metadata.spi;
+
+/**
+ * Simple listener meta data - referencing bean as listener.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface ListenerMetaData
+{
+ String getRef();
+
+ String getBindMethod();
+
+ String getUnbindMethod();
+}
Added: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/OSGiMetaData.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/OSGiMetaData.java 2007-01-04 13:33:58 UTC (rev 59346)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/OSGiMetaData.java 2007-01-04 13:52:53 UTC (rev 59347)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.metadata.spi;
+
+import java.util.Set;
+
+import org.jboss.beans.metadata.spi.ClassLoaderMetaData;
+import org.jboss.beans.metadata.spi.DependencyMetaData;
+import org.jboss.beans.metadata.spi.FeatureMetaData;
+
+/**
+ * Common OSGi meta data attributes.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface OSGiMetaData extends FeatureMetaData
+{
+ String getId();
+
+ String getInterface();
+
+ Set<DependencyMetaData> getDepends();
+
+ ClassLoaderMetaData getContextClassLoader();
+}
Added: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/ReferenceMetaData.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/ReferenceMetaData.java 2007-01-04 13:33:58 UTC (rev 59346)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/ReferenceMetaData.java 2007-01-04 13:52:53 UTC (rev 59347)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.metadata.spi;
+
+import java.util.List;
+import java.util.Set;
+
+import org.jboss.beans.metadata.spi.PropertyMetaData;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+
+/**
+ * OSGi reference meta data.
+ * Extends ValueMetaData - can be used as a value via proxy.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface ReferenceMetaData extends OSGiMetaData, ValueMetaData
+{
+ String getFilter();
+
+ Cardinality getCardinality();
+
+ Integer getTimeout();
+
+ List<ListenerMetaData> getListeners();
+
+ Set<PropertyMetaData> getProperties();
+}
Added: projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/ServiceMetaData.java
===================================================================
--- projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/ServiceMetaData.java 2007-01-04 13:33:58 UTC (rev 59346)
+++ projects/osgi/trunk/deployment/src/main/org/jboss/osgi/metadata/spi/ServiceMetaData.java 2007-01-04 13:52:53 UTC (rev 59347)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.osgi.metadata.spi;
+
+import java.util.Set;
+import java.util.Map;
+
+/**
+ * OSGi service meta data.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface ServiceMetaData extends OSGiMetaData
+{
+ Set<String> getInterfaces();
+
+ Map<String, String> getServiceProperties();
+
+ String getRef();
+
+ boolean getLazyInit();
+}
Added: projects/osgi/trunk/deployment/src/resources/schema/osgi-beans_1_0.xsd
===================================================================
--- projects/osgi/trunk/deployment/src/resources/schema/osgi-beans_1_0.xsd 2007-01-04 13:33:58 UTC (rev 59346)
+++ projects/osgi/trunk/deployment/src/resources/schema/osgi-beans_1_0.xsd 2007-01-04 13:52:53 UTC (rev 59347)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- A prototype xsd schema for the osgi xml deployer -->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:jboss:osgi-beans:1.0"
+ xmlns="urn:jboss:osgi-beans:1.0"
+ xmlns:mc="urn:jboss:beans-deployer:2.0"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.0">
+
+ <xsd:import namespace="urn:jboss:beans-deployer:2.0"/>
+
+ <!-- reference -->
+ <xsd:element name="reference" type="Treference"/>
+
+ <xsd:complexType name="Treference">
+ <xsd:complexContent>
+ <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="property" type="mc:propertyType" minOccurs="0"/>
+ <xsd:element name="listener" type="Tlistener" minOccurs="0"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" use="required" type="xsd:string"/>
+ <xsd:attribute name="interface" use="required" type="xsd:string"/>
+ <xsd:attribute name="filter" use="optional" type="xsd:string"/>
+ <xsd:attribute name="cardinality" use="optional" type="Tcardinality" default="1..1"/>
+ <xsd:attribute name="timeout" use="optional" type="xsd:int" default="0"/>
+ <xsd:attribute name="depends-on" type="xsd:string" use="optional"/>
+ <xsd:attribute name="context-classloader" type="TreferenceClassLoaderOptions" default="client"/>
+ </xsd:complexContent>
+
+ </xsd:complexType>
+
+ <xsd:simpleType name="Tcardinality">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="0..1"/>
+ <xsd:enumeration value="0..n"/>
+ <xsd:enumeration value="1..1"/>
+ <xsd:enumeration value="1..n"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:simpleType name="TreferenceClassLoaderOptions">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="client"/>
+ <xsd:enumeration value="service-provider"/>
+ <xsd:enumeration value="unmanaged"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:complexType name="Tlistener">
+ <xsd:attribute name="ref" type="xsd:string" use="required"/>
+ <xsd:attribute name="bind-method" type="xsd:string" use="optional"/>
+ <xsd:attribute name="unbind-method" type="xsd:string" use="optional"/>
+ </xsd:complexType>
+
+ <!-- service -->
+ <xsd:element name="service" type="Tservice"/>
+
+ <xsd:complexType name="Tservice">
+ <xsd:complexContent>
+ <xsd:sequence minOccurs="0" maxOccurs="1">
+ <xsd:element name="interfaces" type="mc:setType" minOccurs="0"/>
+ <xsd:element name="service-properties" type="mc:mapType" minOccurs="0"/>
+ <!-- this next entry is to allow a nested bean element -->
+ <xsd:any namespace="##other" minOccurs="0" maxOccurs="1" processContents="skip"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:string" use="optional"/>
+ <xsd:attribute name="ref" type="xsd:string" use="optional"/>
+ <xsd:attribute name="interface" type="xsd:string" use="optional"/>
+ <xsd:attribute name="lazy-init" type="xsd:boolean" use="optional" default="false"/>
+ <xsd:attribute name="depends-on" type="xsd:string" use="optional"/>
+ <xsd:attribute name="context-classloader" type="TserviceClassLoaderOptions" default="unmanaged"/>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:simpleType name="TserviceClassLoaderOptions">
+
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="service-provider"/>
+ <xsd:enumeration value="unmanaged"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+</xsd:schema>
More information about the jboss-cvs-commits
mailing list