Commit 692fe737 authored by Nicolas Tachker's avatar Nicolas Tachker
Browse files

move the a3 activator in the a3-osgi artifact.

parent f6a99e2a
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.objectweb.joram</groupId>
<artifactId>a3-osgi</artifactId>
<packaging>bundle</packaging>
<name>JORAM :: a3 :: osgi</name>
<description>Builds the Joram a3 osgi project.</description>
<parent>
<groupId>org.objectweb.joram</groupId>
<artifactId>a3</artifactId>
<version>5.3.3.53-SNAPSHOT</version>
</parent>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
<Bundle-Activator>fr.dyade.aaa.agent.osgi.Activator</Bundle-Activator>
<Export-Package>fr.dyade.aaa.agent.osgi</Export-Package>
<Import-Package>fr.dyade.aaa.agent,
fr.dyade.aaa.common,
fr.dyade.aaa.agent.osgi,
org.osgi.framework,
org.osgi.util.tracker,
org.objectweb.util.monolog,
org.objectweb.util.monolog.api</Import-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.objectweb.joram</groupId>
<artifactId>a3-rt</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -74,7 +74,7 @@ public class Activator implements BundleActivator {
public void start(BundleContext context) throws Exception {
Activator.context = context;
AgentServer.isOSGi = true;
//AgentServer.isOSGi = true;
short sid = getShortProperty(AGENT_SERVER_ID_PROPERTY, (short) 0);
String path = getProperty(AGENT_SERVER_STORAGE_PROPERTY, "s" + sid);
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2009 - 2010 ScalAgent Distributed Technologies
*
* This library 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 any later version.
*
* This library 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 library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): ScalAgent Distributed Technologies
* Contributor(s):
*/
package fr.dyade.aaa.agent.osgi;
import org.objectweb.util.monolog.api.BasicLevel;
import org.objectweb.util.monolog.api.Logger;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;
import fr.dyade.aaa.agent.ServiceDesc;
import fr.dyade.aaa.agent.ServiceManager;
import fr.dyade.aaa.common.Debug;
import fr.dyade.aaa.common.Service;
public class JoramServiceTracker extends ServiceTracker {
public static final Logger logmon = Debug.getLogger(Activator.class.getName());
private ServiceDesc serviceDesc;
public JoramServiceTracker(ServiceDesc desc) throws Exception {
super(Activator.context, Activator.context.createFilter('(' + Service.SERVICE_NAME_PROP + '='
+ desc.getClassName() + ')'), null);
serviceDesc = desc;
}
public Object addingService(ServiceReference reference) {
Object service = context.getService(reference);
try {
ServiceManager.doStart(serviceDesc);
} catch (Exception exc) {
if (logmon.isLoggable(BasicLevel.ERROR))
logmon.log(BasicLevel.ERROR, "Error starting service. ", exc);
}
return service;
}
public void removedService(ServiceReference reference, Object service) {
try {
ServiceManager.stop(serviceDesc);
} catch (Exception exc) {
if (logmon.isLoggable(BasicLevel.ERROR))
logmon.log(BasicLevel.ERROR, "Error stopping service.", exc);
}
super.removedService(reference, service);
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment