Author: rwonly
Date: Fri Dec 4 05:49:21 2009
New Revision: 887071
URL: http://svn.apache.org/viewvc?rev=887071&view=rev
Log:
add demo
Added:
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/pom.xml
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/jmx/
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/jmx/demo/
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/jmx/demo/Activator.java
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/jmx/demo/RemoteMonitor.java
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/Bar.java
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/BindingListener.java
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/CurrencyTypeConverter.java
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/DateTypeConverter.java
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/Foo.java
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/FooRegistrationListener.java
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/InterfaceA.java
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/resources/
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/resources/OSGI-INF/
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/resources/OSGI-INF/blueprint/
geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/resources/OSGI-INF/blueprint/config.xml
Modified:
geronimo/sandbox/rex/pom.xml
Added: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/pom.xml?rev=887071&view=auto
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/pom.xml (added)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/pom.xml Fri Dec 4 05:49:21 2009
@@ -0,0 +1,64 @@
+
+ 4.0.0
+
+ org.apache.geronimo.blueprint
+ jmx-parent
+ 1.0-SNAPSHOT
+
+
+ org.apache.geronimo.blueprint.jmx.demo
+ bundle
+ Apache Geronimo Blueprint Jmx Demo
+
+
+
+ org.osgi
+ org.osgi.core
+ 4.2.0
+
+
+ org.osgi
+ org.osgi.compendium
+ 4.2.0
+
+
+ org.apache.geronimo.blueprint
+ org.apache.geronimo.blueprint.jmx
+ 1.0-SNAPSHOT
+
+
+ org.apache.geronimo.blueprint
+ org.apache.geronimo.blueprint.jmx.impl
+ 1.0-SNAPSHOT
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+ 1.6
+ 1.6
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+ true
+
+
+ org.apache.geronimo.blueprint.jmx.demo
+ Apache Geronimo Blueprint Jmx Demo
+ Apache Geronimo Blueprint Jmx demo.
+ The Apache Software Foundation
+ org.apache.geronimo.blueprint.jmx.demo.Activator
+
+
+
+
+
+
+
Added: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/jmx/demo/Activator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/jmx/demo/Activator.java?rev=887071&view=auto
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/jmx/demo/Activator.java (added)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/jmx/demo/Activator.java Fri Dec 4 05:49:21 2009
@@ -0,0 +1,48 @@
+package org.apache.geronimo.blueprint.jmx.demo;
+
+import java.lang.management.ManagementFactory;
+
+import javax.management.MBeanServer;
+import javax.management.remote.JMXConnectorServer;
+import javax.management.remote.JMXConnectorServerFactory;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.util.tracker.ServiceTracker;
+// import org.slf4j.Logger;
+// import org.slf4j.LoggerFactory;
+
+public class Activator implements BundleActivator {
+ //private static final Logger logger = LoggerFactory.getLogger(Activator.class);
+
+ BundleContext context;
+ ServiceRegistration reg;
+
+ protected ServiceTracker containerServiceTracker;
+
+ //@Override
+ public void start(BundleContext context) throws Exception {
+ this.context = context;
+
+ // register a MBeanServer service
+ MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
+ reg = context.registerService(MBeanServer.class.getName(), mbs, null);
+ //logger.debug("A MBeanServer " + mbs + " has been registered into service registry");
+
+ // Create an RMI connector and start it
+ JMXConnectorServer cs = JMXConnectorServerFactory.newJMXConnectorServer(RemoteMonitor.url, null, mbs);
+ cs.start();
+
+ //logger.debug("A JMXConnectorServer has started.");
+
+ RemoteMonitor test = new RemoteMonitor(context.getBundle().getBundleId());
+ new Thread(test).start();
+ }
+
+ //@Override
+ public void stop(BundleContext context) throws Exception {
+ containerServiceTracker.close();
+ reg.unregister();
+ }
+}
Added: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/jmx/demo/RemoteMonitor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/jmx/demo/RemoteMonitor.java?rev=887071&view=auto
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/jmx/demo/RemoteMonitor.java (added)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/jmx/demo/RemoteMonitor.java Fri Dec 4 05:49:21 2009
@@ -0,0 +1,141 @@
+package org.apache.geronimo.blueprint.jmx.demo;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import javax.management.JMX;
+import javax.management.MBeanServerConnection;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.management.openmbean.CompositeData;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+
+import org.apache.geronimo.blueprint.jmx.BlueprintMetadataMBean;
+import org.apache.geronimo.blueprint.jmx.impl.codec.BPMapEntry;
+import org.apache.geronimo.blueprint.jmx.impl.codec.BPServiceMetadata;
+import org.apache.geronimo.blueprint.jmx.impl.codec.BPValueMetadata;
+
+public class RemoteMonitor implements Runnable {
+ public static final ObjectName objectName = initObjectName();
+ public static final JMXServiceURL url = initJMXServiceURL();
+
+ private static ObjectName initObjectName() {
+ ObjectName tmp = null;
+ try {
+ tmp = new ObjectName(BlueprintMetadataMBean.OBJECTNAME);
+ } catch (MalformedObjectNameException e) {
+ e.printStackTrace();
+ }
+ return tmp;
+ }
+
+ private static JMXServiceURL initJMXServiceURL() {
+ JMXServiceURL tmp = null;
+ try {
+ tmp = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:9999/server");
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+ return tmp;
+ }
+
+ // private BlueprintContainer container;
+
+ private BlueprintMetadataMBean mbean;
+
+ private long bundleId;
+
+ public RemoteMonitor(long bundleId) {
+ this.bundleId = bundleId;
+ }
+
+ public void run() {
+ // get mbean reference
+ JMXConnector jmxc;
+ try {
+ jmxc = JMXConnectorFactory.connect(url);
+ MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();
+ while (!mbsc.isRegistered(objectName))
+ Thread.sleep(1000);
+ mbean = JMX.newMBeanProxy(mbsc, objectName, BlueprintMetadataMBean.class);
+
+ checkMetadata();
+ checkState();
+ jmxc.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void checkMetadata() {
+ long serviceId = -1;
+ try {
+ while (serviceId < 0) {
+ serviceId = mbean.getBlueprintContainerServiceId(bundleId);
+
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ printLong("getBlueprintContainerServiceId", serviceId);
+
+ long[] ids = mbean.getBlueprintContainerServiceIds();
+ printLong("getBlueprintContainerServiceIds", ids);
+
+ String[] cids = mbean.getComponentIds(serviceId);
+ printString("getComponentIds", cids);
+
+ String[] bids = mbean.getComponentIdsByType(serviceId, BlueprintMetadataMBean.BEAN_METADATA);
+ printString("getComponentIdsByType - " + BlueprintMetadataMBean.BEAN_METADATA, bids);
+
+ String[] sids = mbean.getComponentIdsByType(serviceId, BlueprintMetadataMBean.SERVICE_METADATA);
+ printString("getComponentIdsByType - " + BlueprintMetadataMBean.SERVICE_METADATA, sids);
+
+ String[] rids = mbean.getComponentIdsByType(serviceId, BlueprintMetadataMBean.SERVICE_REFERENCE_METADATA);
+ printString("getComponentIdsByType - " + BlueprintMetadataMBean.SERVICE_REFERENCE_METADATA, rids);
+
+ for (String id : sids) {
+ CompositeData cd = mbean.getComponentMetadata(serviceId, id);
+ BPServiceMetadata smd = new BPServiceMetadata(cd);
+
+ System.out.println(tag+ "ServiceMetadata - " + id);
+ System.out.println(smd.getId());
+ System.out.println(smd.getRanking());
+ for (String $interface : smd.getInterfaces()) {
+ System.out.println($interface);
+ }
+ for (BPMapEntry entry : smd.getServiceProperties()) {
+ BPValueMetadata key = (BPValueMetadata) entry.getKey();
+ BPValueMetadata value = (BPValueMetadata) entry.getValue();
+ System.out.println(key.getStringValue());
+ System.out.println(value.getStringValue());
+ }
+ }
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void checkState() {
+
+ }
+
+ public static final String tag = "********************************************";
+ private static void printString(String info, String... array) {
+ System.out.println(tag + info);
+ for (String obj : array)
+ System.out.println(obj);
+ }
+
+ private static void printLong(String info, long... array) {
+ System.out.println(tag + info);
+ for (long obj : array)
+ System.out.println(obj);
+ }
+}
Added: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/Bar.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/Bar.java?rev=887071&view=auto
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/Bar.java (added)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/Bar.java Fri Dec 4 05:49:21 2009
@@ -0,0 +1,57 @@
+/**
+ * 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.geronimo.blueprint.sample;
+
+import java.util.List;
+
+import org.osgi.framework.BundleContext;
+
+public class Bar {
+
+ private BundleContext context;
+ private String value;
+ private List list;
+
+ public BundleContext getContext() {
+ return context;
+ }
+
+ public void setContext(BundleContext ctx) {
+ context = ctx;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String s) {
+ value = s;
+ }
+
+ public List getList() {
+ return list;
+ }
+
+ public void setList(List l) {
+ list = l;
+ }
+
+ public String toString() {
+ return hashCode() + ": " + value + " " + context + " " + list;
+ }
+
+}
Added: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/BindingListener.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/BindingListener.java?rev=887071&view=auto
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/BindingListener.java (added)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/BindingListener.java Fri Dec 4 05:49:21 2009
@@ -0,0 +1,72 @@
+/**
+ * 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.geronimo.blueprint.sample;
+
+import java.util.Map;
+import java.util.List;
+import java.io.Serializable;
+
+import org.osgi.framework.ServiceReference;
+
+public class BindingListener {
+
+ private InterfaceA a;
+ private Map props;
+ private ServiceReference reference;
+ private List list;
+
+ public InterfaceA getA() {
+ return a;
+ }
+
+ public Map getProps() {
+ return props;
+ }
+
+ public ServiceReference getReference() {
+ return reference;
+ }
+
+ public List getList() {
+ return list;
+ }
+
+ public void setList(List list) {
+ this.list = list;
+ }
+
+ public void init() {
+ }
+
+ public void bind(InterfaceA a, Map props) {
+ this.a = a;
+ this.props = props;
+ }
+
+ public void bind(ServiceReference ref) {
+ this.reference = ref;
+ }
+
+ public void unbind(InterfaceA a, Map props) {
+ this.a = null;
+ this.props = null;
+ }
+
+ public void unbind(ServiceReference ref) {
+ this.reference = null;
+ }
+}
Added: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/CurrencyTypeConverter.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/CurrencyTypeConverter.java?rev=887071&view=auto
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/CurrencyTypeConverter.java (added)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/CurrencyTypeConverter.java Fri Dec 4 05:49:21 2009
@@ -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.geronimo.blueprint.sample;
+
+import java.util.Currency;
+
+import org.osgi.service.blueprint.container.Converter;
+import org.osgi.service.blueprint.container.ReifiedType;
+
+public class CurrencyTypeConverter implements Converter {
+
+ public boolean canConvert(Object fromValue, ReifiedType toType) {
+ return Currency.class.isAssignableFrom(toType.getRawClass());
+ }
+
+ public Object convert(Object source, ReifiedType toType) throws Exception {
+ return Currency.getInstance(source.toString());
+ }
+
+}
Added: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/DateTypeConverter.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/DateTypeConverter.java?rev=887071&view=auto
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/DateTypeConverter.java (added)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/DateTypeConverter.java Fri Dec 4 05:49:21 2009
@@ -0,0 +1,42 @@
+/**
+ * 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.geronimo.blueprint.sample;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.osgi.service.blueprint.container.Converter;
+import org.osgi.service.blueprint.container.ReifiedType;
+
+public class DateTypeConverter implements Converter {
+
+ DateFormat dateFormat;
+
+ public void setFormat(String format) {
+ dateFormat = new SimpleDateFormat(format);
+ }
+
+ public Object convert(Object source, ReifiedType toType) throws Exception {
+ return dateFormat.parse(source.toString());
+ }
+
+ public boolean canConvert(Object fromValue, ReifiedType toType) {
+ return Date.class.isAssignableFrom(toType.getRawClass());
+ }
+
+}
Added: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/Foo.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/Foo.java?rev=887071&view=auto
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/Foo.java (added)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/Foo.java Fri Dec 4 05:49:21 2009
@@ -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.geronimo.blueprint.sample;
+
+import java.io.Serializable;
+import java.util.Currency;
+import java.util.Date;
+import java.util.Map;
+
+public class Foo implements Serializable {
+
+ private int a;
+ private int b;
+ private Bar bar;
+ private Currency currency;
+ private Date date;
+
+ public boolean initialized;
+ public boolean destroyed;
+ private Map props;
+
+ public int getA() {
+ return a;
+ }
+
+ public void setA(int i) {
+ a = i;
+ }
+
+ public int getB() {
+ return b;
+ }
+
+ public void setB(int i) {
+ b = i;
+ }
+
+ public Bar getBar() {
+ return bar;
+ }
+
+ public void setBar(Bar b) {
+ bar = b;
+ }
+
+ public Currency getCurrency() {
+ return currency;
+ }
+
+ public void setCurrency(Currency c) {
+ currency = c;
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ public void setDate(Date d) {
+ date = d;
+ }
+
+ public String toString() {
+ return a + " " + b + " " + bar + " " + currency + " " + date;
+ }
+
+ public void init() {
+ System.out.println("======== Initializing Foo =========");
+ initialized = true;
+ }
+
+ public void destroy() {
+ System.out.println("======== Destroying Foo =========");
+ destroyed = true;
+ }
+
+ public boolean isInitialized() {
+ return initialized;
+ }
+
+ public boolean isDestroyed() {
+ return destroyed;
+ }
+
+ public void update(Map props) {
+ this.props = props;
+ }
+
+ public Map getProps() {
+ return props;
+ }
+}
+
Added: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/FooRegistrationListener.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/FooRegistrationListener.java?rev=887071&view=auto
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/FooRegistrationListener.java (added)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/FooRegistrationListener.java Fri Dec 4 05:49:21 2009
@@ -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.geronimo.blueprint.sample;
+
+import java.io.Serializable;
+import java.util.Map;
+
+public class FooRegistrationListener {
+
+ public void serviceRegistered(Serializable foo, Map props) {
+ System.out.println("Service registration notification: " + foo + " " + props);
+ }
+
+ public void serviceUnregistered(Foo foo, Map props) {
+ System.out.println("Service unregistration notification: " + foo + " " + props);
+ }
+
+}
Added: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/InterfaceA.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/InterfaceA.java?rev=887071&view=auto
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/InterfaceA.java (added)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/java/org/apache/geronimo/blueprint/sample/InterfaceA.java Fri Dec 4 05:49:21 2009
@@ -0,0 +1,22 @@
+/**
+ * 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.geronimo.blueprint.sample;
+
+public interface InterfaceA {
+
+ String hello(String msg);
+}
Added: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/resources/OSGI-INF/blueprint/config.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/resources/OSGI-INF/blueprint/config.xml?rev=887071&view=auto
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/resources/OSGI-INF/blueprint/config.xml (added)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.demo/src/main/resources/OSGI-INF/blueprint/config.xml Fri Dec 4 05:49:21 2009
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ file://url
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PLN
+
+
+ 2009.04.17
+
+
+
+
+ Hello FooBar
+
+
+
+ a list element
+ 5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Modified: geronimo/sandbox/rex/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/pom.xml?rev=887071&r1=887070&r2=887071&view=diff
==============================================================================
--- geronimo/sandbox/rex/pom.xml (original)
+++ geronimo/sandbox/rex/pom.xml Fri Dec 4 05:49:21 2009
@@ -40,6 +40,7 @@
org.apache.geronimo.blueprint.jmx.impl
org.apache.geronimo.blueprint.jmx.test
org.apache.geronimo.blueprint.jmx.agent
+ org.apache.geronimo.blueprint.jmx.demo