From 1e0abe67a18a9dbdcdafffaf09073a24ae579f2c Mon Sep 17 00:00:00 2001 From: objectiser Date: Fri, 18 Jan 2013 22:22:32 +0000 Subject: [PATCH] Remove OSGI bundle activators --- .../java/org/savara/bpel/osgi/Activator.java | 49 ----------- .../savara/bpmn2/model/osgi/Activator.java | 33 ------- .../java/org/savara/bpmn2/osgi/Activator.java | 49 ----------- .../common/config/file/osgi/Activator.java | 64 -------------- .../org/savara/common/osgi/Activator.java | 30 ------- .../org/savara/contract/osgi/Activator.java | 39 -------- .../java/org/savara/java/osgi/Activator.java | 47 ---------- .../monitor/sstore/rdbms/osgi/Activator.java | 64 -------------- .../org/savara/monitor/osgi/Activator.java | 30 ------- .../org/savara/pi4soa/cdm/osgi/Activator.java | 40 --------- .../org/savara/sca/java/osgi/Activator.java | 30 ------- .../simulator/cdm/osgi/Activator.java | 49 ----------- .../simulator/protocol/osgi/Activator.java | 49 ----------- .../simulator/sca/osgi/Activator.java | 65 -------------- .../simulator/switchyard/osgi/Activator.java | 65 -------------- .../org/savara/scenario/osgi/Activator.java | 88 ------------------- 16 files changed, 791 deletions(-) delete mode 100644 bundles/org.savara.bpel/src/main/java/org/savara/bpel/osgi/Activator.java delete mode 100644 bundles/org.savara.bpmn2.model/src/main/java/org/savara/bpmn2/model/osgi/Activator.java delete mode 100644 bundles/org.savara.bpmn2/src/main/java/org/savara/bpmn2/osgi/Activator.java delete mode 100644 bundles/org.savara.common.config.file/src/main/java/org/savara/common/config/file/osgi/Activator.java delete mode 100644 bundles/org.savara.common/src/main/java/org/savara/common/osgi/Activator.java delete mode 100644 bundles/org.savara.contract/src/main/java/org/savara/contract/osgi/Activator.java delete mode 100644 bundles/org.savara.java/src/main/java/org/savara/java/osgi/Activator.java delete mode 100644 bundles/org.savara.monitor.sstore.rdbms/src/main/java/org/savara/monitor/sstore/rdbms/osgi/Activator.java delete mode 100644 bundles/org.savara.monitor/src/main/java/org/savara/monitor/osgi/Activator.java delete mode 100644 bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/osgi/Activator.java delete mode 100644 bundles/org.savara.sca.java/src/main/java/org/savara/sca/java/osgi/Activator.java delete mode 100644 bundles/org.savara.scenario.simulator.cdm/src/main/java/org/savara/scenario/simulator/cdm/osgi/Activator.java delete mode 100644 bundles/org.savara.scenario.simulator.protocol/src/main/java/org/savara/scenario/simulator/protocol/osgi/Activator.java delete mode 100644 bundles/org.savara.scenario.simulator.sca/src/main/java/org/savara/scenario/simulator/sca/osgi/Activator.java delete mode 100644 bundles/org.savara.scenario.simulator.switchyard/src/main/java/org/savara/scenario/simulator/switchyard/osgi/Activator.java delete mode 100644 bundles/org.savara.scenario/src/main/java/org/savara/scenario/osgi/Activator.java diff --git a/bundles/org.savara.bpel/src/main/java/org/savara/bpel/osgi/Activator.java b/bundles/org.savara.bpel/src/main/java/org/savara/bpel/osgi/Activator.java deleted file mode 100644 index 8fa1267..0000000 --- a/bundles/org.savara.bpel/src/main/java/org/savara/bpel/osgi/Activator.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.savara.bpel.osgi; - -import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.savara.bpel.parser.BPELProtocolParser; -import org.scribble.protocol.parser.ProtocolParser; - -public class Activator implements BundleActivator { - - private static final Logger LOG=Logger.getLogger(Activator.class.getName()); - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - - Properties props = new Properties(); - - BPELProtocolParser pp=new BPELProtocolParser(); - - context.registerService(ProtocolParser.class.getName(), - pp, props); - - if (LOG.isLoggable(Level.FINE)) { - LOG.fine("BPEL Protocol Parser registered"); - } - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/bundles/org.savara.bpmn2.model/src/main/java/org/savara/bpmn2/model/osgi/Activator.java b/bundles/org.savara.bpmn2.model/src/main/java/org/savara/bpmn2/model/osgi/Activator.java deleted file mode 100644 index 6d27467..0000000 --- a/bundles/org.savara.bpmn2.model/src/main/java/org/savara/bpmn2/model/osgi/Activator.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008-12, Red Hat Middleware LLC, and others contributors as indicated - * by the @authors tag. All rights reserved. - * See the copyright.txt in the distribution for a - * full listing of individual contributors. - * This copyrighted material is made available to anyone wishing to use, - * modify, copy, or redistribute it subject to the terms and conditions - * of the GNU Lesser General Public License, v. 2.1. - * This program is distributed in the hope that it will be useful, but WITHOUT A - * 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, - * v.2.1 along with this distribution; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ -package org.savara.bpmn2.model.osgi; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - public void start(BundleContext context) throws Exception { - - } - - public void stop(BundleContext context) throws Exception { - - } - -} diff --git a/bundles/org.savara.bpmn2/src/main/java/org/savara/bpmn2/osgi/Activator.java b/bundles/org.savara.bpmn2/src/main/java/org/savara/bpmn2/osgi/Activator.java deleted file mode 100644 index 20cd1f9..0000000 --- a/bundles/org.savara.bpmn2/src/main/java/org/savara/bpmn2/osgi/Activator.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.savara.bpmn2.osgi; - -import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.savara.bpmn2.parser.choreo.BPMN2ChoreographyProtocolParser; -import org.scribble.protocol.parser.ProtocolParser; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - private static final Logger LOG=Logger.getLogger(Activator.class.getName()); - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - - Properties props = new Properties(); - - BPMN2ChoreographyProtocolParser pp=new BPMN2ChoreographyProtocolParser(); - - context.registerService(ProtocolParser.class.getName(), - pp, props); - - if (LOG.isLoggable(Level.FINE)) { - LOG.fine("BPMN2 Protocol Parser registered"); - } - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/bundles/org.savara.common.config.file/src/main/java/org/savara/common/config/file/osgi/Activator.java b/bundles/org.savara.common.config.file/src/main/java/org/savara/common/config/file/osgi/Activator.java deleted file mode 100644 index 1567b2d..0000000 --- a/bundles/org.savara.common.config.file/src/main/java/org/savara/common/config/file/osgi/Activator.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008-11, Red Hat Middleware LLC, and others contributors as indicated - * by the @authors tag. All rights reserved. - * See the copyright.txt in the distribution for a - * full listing of individual contributors. - * This copyrighted material is made available to anyone wishing to use, - * modify, copy, or redistribute it subject to the terms and conditions - * of the GNU Lesser General Public License, v. 2.1. - * This program is distributed in the hope that it will be useful, but WITHOUT A - * 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, - * v.2.1 along with this distribution; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ -package org.savara.common.config.file.osgi; - -import java.util.Properties; -import java.util.logging.Logger; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.savara.common.config.Configuration; -import org.savara.common.config.file.FileConfiguration; - -public class Activator implements BundleActivator { - - private static final Logger _log=Logger.getLogger(Activator.class.getName()); - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - - Properties props = new Properties(); - - // Register parser manager - final Configuration config=new FileConfiguration(); - - context.registerService(Configuration.class.getName(), - config, props); - - _log.info("Registered File based Configuration"); - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/bundles/org.savara.common/src/main/java/org/savara/common/osgi/Activator.java b/bundles/org.savara.common/src/main/java/org/savara/common/osgi/Activator.java deleted file mode 100644 index d4c872f..0000000 --- a/bundles/org.savara.common/src/main/java/org/savara/common/osgi/Activator.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.savara.common.osgi; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/bundles/org.savara.contract/src/main/java/org/savara/contract/osgi/Activator.java b/bundles/org.savara.contract/src/main/java/org/savara/contract/osgi/Activator.java deleted file mode 100644 index d7bc15f..0000000 --- a/bundles/org.savara.contract/src/main/java/org/savara/contract/osgi/Activator.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated - * by the @authors tag. All rights reserved. - * See the copyright.txt in the distribution for a - * full listing of individual contributors. - * This copyrighted material is made available to anyone wishing to use, - * modify, copy, or redistribute it subject to the terms and conditions - * of the GNU Lesser General Public License, v. 2.1. - * This program is distributed in the hope that it will be useful, but WITHOUT A - * 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, - * v.2.1 along with this distribution; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ -package org.savara.contract.osgi; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - } - -} diff --git a/bundles/org.savara.java/src/main/java/org/savara/java/osgi/Activator.java b/bundles/org.savara.java/src/main/java/org/savara/java/osgi/Activator.java deleted file mode 100644 index cb96518..0000000 --- a/bundles/org.savara.java/src/main/java/org/savara/java/osgi/Activator.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008-12, Red Hat Middleware LLC, and others contributors as indicated - * by the @authors tag. All rights reserved. - * See the copyright.txt in the distribution for a - * full listing of individual contributors. - * This copyrighted material is made available to anyone wishing to use, - * modify, copy, or redistribute it subject to the terms and conditions - * of the GNU Lesser General Public License, v. 2.1. - * This program is distributed in the hope that it will be useful, but WITHOUT A - * 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, - * v.2.1 along with this distribution; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ -package org.savara.java.osgi; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/bundles/org.savara.monitor.sstore.rdbms/src/main/java/org/savara/monitor/sstore/rdbms/osgi/Activator.java b/bundles/org.savara.monitor.sstore.rdbms/src/main/java/org/savara/monitor/sstore/rdbms/osgi/Activator.java deleted file mode 100644 index 8fac381..0000000 --- a/bundles/org.savara.monitor.sstore.rdbms/src/main/java/org/savara/monitor/sstore/rdbms/osgi/Activator.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated - * by the @authors tag. All rights reserved. - * See the copyright.txt in the distribution for a - * full listing of individual contributors. - * This copyrighted material is made available to anyone wishing to use, - * modify, copy, or redistribute it subject to the terms and conditions - * of the GNU Lesser General Public License, v. 2.1. - * This program is distributed in the hope that it will be useful, but WITHOUT A - * 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, - * v.2.1 along with this distribution; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ -package org.savara.monitor.sstore.rdbms.osgi; - -import java.util.Properties; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; -import org.savara.monitor.SessionStore; -import org.savara.monitor.sstore.rdbms.RDBMSSessionStore; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - private ServiceRegistration m_serviceRegistration=null; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - - // Register the SessionStore implementation - Properties props = new Properties(); - - SessionStore ss=new RDBMSSessionStore(); - - m_serviceRegistration = context.registerService(SessionStore.class.getName(), - ss, props); -} - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - - m_serviceRegistration.unregister(); - } - -} diff --git a/bundles/org.savara.monitor/src/main/java/org/savara/monitor/osgi/Activator.java b/bundles/org.savara.monitor/src/main/java/org/savara/monitor/osgi/Activator.java deleted file mode 100644 index 1233cec..0000000 --- a/bundles/org.savara.monitor/src/main/java/org/savara/monitor/osgi/Activator.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.savara.monitor.osgi; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/osgi/Activator.java b/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/osgi/Activator.java deleted file mode 100644 index feeb6ec..0000000 --- a/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/osgi/Activator.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.savara.pi4soa.cdm.osgi; - -import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.savara.pi4soa.cdm.parser.CDMProtocolParser; -import org.scribble.protocol.parser.ProtocolParser; - -public class Activator implements BundleActivator { - - private static final Logger logger=Logger.getLogger(Activator.class.getName()); - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - Properties props = new Properties(); - - CDMProtocolParser pp=new CDMProtocolParser(); - - context.registerService(ProtocolParser.class.getName(), - pp, props); - - if (logger.isLoggable(Level.FINE)) { - logger.fine("CDM Protocol Parser registered"); - } - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - } - -} diff --git a/bundles/org.savara.sca.java/src/main/java/org/savara/sca/java/osgi/Activator.java b/bundles/org.savara.sca.java/src/main/java/org/savara/sca/java/osgi/Activator.java deleted file mode 100644 index cab91ec..0000000 --- a/bundles/org.savara.sca.java/src/main/java/org/savara/sca/java/osgi/Activator.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.savara.sca.java.osgi; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/bundles/org.savara.scenario.simulator.cdm/src/main/java/org/savara/scenario/simulator/cdm/osgi/Activator.java b/bundles/org.savara.scenario.simulator.cdm/src/main/java/org/savara/scenario/simulator/cdm/osgi/Activator.java deleted file mode 100644 index 6d1eb9e..0000000 --- a/bundles/org.savara.scenario.simulator.cdm/src/main/java/org/savara/scenario/simulator/cdm/osgi/Activator.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.savara.scenario.simulator.cdm.osgi; - -import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.savara.scenario.simulation.RoleSimulator; -import org.savara.scenario.simulator.cdm.CDMRoleSimulator; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - private static final Logger logger=Logger.getLogger(Activator.class.getName()); - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - - Properties props = new Properties(); - - CDMRoleSimulator rs=new CDMRoleSimulator(); - - context.registerService(RoleSimulator.class.getName(), - rs, props); - - if (logger.isLoggable(Level.FINE)) { - logger.fine("CDM Role Simulator registered"); - } -} - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/bundles/org.savara.scenario.simulator.protocol/src/main/java/org/savara/scenario/simulator/protocol/osgi/Activator.java b/bundles/org.savara.scenario.simulator.protocol/src/main/java/org/savara/scenario/simulator/protocol/osgi/Activator.java deleted file mode 100644 index e22a409..0000000 --- a/bundles/org.savara.scenario.simulator.protocol/src/main/java/org/savara/scenario/simulator/protocol/osgi/Activator.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.savara.scenario.simulator.protocol.osgi; - -import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.savara.scenario.simulation.RoleSimulator; -import org.savara.scenario.simulator.protocol.ProtocolRoleSimulator; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - private static final Logger logger=Logger.getLogger(Activator.class.getName()); - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - - Properties props = new Properties(); - - ProtocolRoleSimulator rs=new ProtocolRoleSimulator(); - - context.registerService(RoleSimulator.class.getName(), - rs, props); - - if (logger.isLoggable(Level.FINE)) { - logger.fine("Protocol Role Simulator registered"); - } - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/bundles/org.savara.scenario.simulator.sca/src/main/java/org/savara/scenario/simulator/sca/osgi/Activator.java b/bundles/org.savara.scenario.simulator.sca/src/main/java/org/savara/scenario/simulator/sca/osgi/Activator.java deleted file mode 100644 index a5a182d..0000000 --- a/bundles/org.savara.scenario.simulator.sca/src/main/java/org/savara/scenario/simulator/sca/osgi/Activator.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008-11, Red Hat Middleware LLC, and others contributors as indicated - * by the @authors tag. All rights reserved. - * See the copyright.txt in the distribution for a - * full listing of individual contributors. - * This copyrighted material is made available to anyone wishing to use, - * modify, copy, or redistribute it subject to the terms and conditions - * of the GNU Lesser General Public License, v. 2.1. - * This program is distributed in the hope that it will be useful, but WITHOUT A - * 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, - * v.2.1 along with this distribution; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ -package org.savara.scenario.simulator.sca.osgi; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.savara.scenario.simulation.RoleSimulator; -import org.savara.scenario.simulator.sca.SCARoleSimulator; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - private static final Logger logger=Logger.getLogger(Activator.class.getName()); - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - - //Properties props = new Properties(); - - SCARoleSimulator rs=new SCARoleSimulator(); - - context.registerService(RoleSimulator.class.getName(), - rs, null); - - if (logger.isLoggable(Level.FINE)) { - logger.fine("SCA Role Simulator registered"); - } - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/bundles/org.savara.scenario.simulator.switchyard/src/main/java/org/savara/scenario/simulator/switchyard/osgi/Activator.java b/bundles/org.savara.scenario.simulator.switchyard/src/main/java/org/savara/scenario/simulator/switchyard/osgi/Activator.java deleted file mode 100644 index e1d8dce..0000000 --- a/bundles/org.savara.scenario.simulator.switchyard/src/main/java/org/savara/scenario/simulator/switchyard/osgi/Activator.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008-11, Red Hat Middleware LLC, and others contributors as indicated - * by the @authors tag. All rights reserved. - * See the copyright.txt in the distribution for a - * full listing of individual contributors. - * This copyrighted material is made available to anyone wishing to use, - * modify, copy, or redistribute it subject to the terms and conditions - * of the GNU Lesser General Public License, v. 2.1. - * This program is distributed in the hope that it will be useful, but WITHOUT A - * 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, - * v.2.1 along with this distribution; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ -package org.savara.scenario.simulator.switchyard.osgi; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.savara.scenario.simulation.RoleSimulator; -import org.savara.scenario.simulator.switchyard.SwitchyardRoleSimulator; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - private static final Logger logger=Logger.getLogger(Activator.class.getName()); - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - - //Properties props = new Properties(); - - SwitchyardRoleSimulator rs=new SwitchyardRoleSimulator(); - - context.registerService(RoleSimulator.class.getName(), - rs, null); - - if (logger.isLoggable(Level.FINE)) { - logger.fine("Switchyard Role Simulator registered"); - } - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/bundles/org.savara.scenario/src/main/java/org/savara/scenario/osgi/Activator.java b/bundles/org.savara.scenario/src/main/java/org/savara/scenario/osgi/Activator.java deleted file mode 100644 index 3258fde..0000000 --- a/bundles/org.savara.scenario/src/main/java/org/savara/scenario/osgi/Activator.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated - * by the @authors tag. All rights reserved. - * See the copyright.txt in the distribution for a - * full listing of individual contributors. - * This copyrighted material is made available to anyone wishing to use, - * modify, copy, or redistribute it subject to the terms and conditions - * of the GNU Lesser General Public License, v. 2.1. - * This program is distributed in the hope that it will be useful, but WITHOUT A - * 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, - * v.2.1 along with this distribution; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ -package org.savara.scenario.osgi; - -import java.util.Properties; -import java.util.logging.Logger; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.util.tracker.ServiceTracker; -import org.savara.scenario.simulation.DefaultScenarioSimulator; -import org.savara.scenario.simulation.RoleSimulator; -import org.savara.scenario.simulation.RoleSimulatorFactory; -import org.savara.scenario.simulation.ScenarioSimulator; - -public class Activator implements BundleActivator { - - private org.osgi.util.tracker.ServiceTracker m_roleSimulatorTracker=null; - - private static final Logger logger=Logger.getLogger(Activator.class.getName()); - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - - // Register the scenario simulator implementation - Properties props = new Properties(); - - ScenarioSimulator ssim=new DefaultScenarioSimulator(); - - context.registerService(ScenarioSimulator.class.getName(), - ssim, props); - - logger.info("Registered Scenario Simulator"); - - // Obtain references to role simulators - /* - ServiceReference sref=context.getServiceReference(RoleSimulator.class.getName()); - - if (sref != null) { - RoleSimulator rs=(RoleSimulator)context.getService(sref); - RoleSimulatorFactory.register(rs); - } else { - */ - m_roleSimulatorTracker = new ServiceTracker(context, - RoleSimulator.class.getName(), null) { - - public Object addingService(ServiceReference ref) { - Object ret=super.addingService(ref); - - logger.fine("Role simulator being registered: "+ret); - - RoleSimulatorFactory.register((RoleSimulator)ret); - - return(ret); - } - }; - - m_roleSimulatorTracker.open(); - //} - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - } - -}