You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ace.apache.org by br...@apache.org on 2013/08/28 16:53:00 UTC
svn commit: r1518229 - in /ace/trunk/org.apache.ace.agent: README bnd.bnd
src/org/apache/ace/agent/impl/DefaultController.java
src/org/apache/ace/agent/updater/Activator.java
Author: bramk
Date: Wed Aug 28 14:52:59 2013
New Revision: 1518229
URL: http://svn.apache.org/r1518229
Log:
ACE-347 Small codestyle, FIXME, README tweaks
Modified:
ace/trunk/org.apache.ace.agent/README
ace/trunk/org.apache.ace.agent/bnd.bnd
ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java
ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/updater/Activator.java
Modified: ace/trunk/org.apache.ace.agent/README
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.agent/README?rev=1518229&r1=1518228&r2=1518229&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.agent/README (original)
+++ ace/trunk/org.apache.ace.agent/README Wed Aug 28 14:52:59 2013
@@ -1,14 +1,25 @@
-TODOs:
+Work in progress
-1) Download handler now store files in a tmp file and are not able to resume interrupted
-downloads from a new handle. This should be changed to storage in the data dir and using
-names that can be discovered and resumed.
-2) Download result provide access to the download through a File. This should be an
-inputstream.
+On downloads:
+1) Download ared stored temp-files and as a result it is not possible to resume interrupted
+downloads from a new handle. This should be changed to storage in the data dir using names
+based in url so that they that can be discovered and resumed.
-3) EventsHandler/EVentListener do not yet support an interest list like eventadmin does.
-This should be added as it will help reduce event load if we start throwing more.
+2) Download result provides access to the download through a File. To be more clean this
+should be an inputstream.
+
+On events:
+
+1) The EventsHandler/EventListener mechanism does not yet support a topic interest list like
+eventadmin does. This should be added as it will help reduce event load if we start throwing
+more.
+
+2) To reduce the overhead of configuration lookup we should consider adding config changed
+events that other components can register to.
+
+3) At this point the only events are those posted by the DeploymentAdmin. We should think
+about which agent events make sense and add them.
Modified: ace/trunk/org.apache.ace.agent/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.agent/bnd.bnd?rev=1518229&r1=1518228&r2=1518229&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.agent/bnd.bnd (original)
+++ ace/trunk/org.apache.ace.agent/bnd.bnd Wed Aug 28 14:52:59 2013
@@ -43,4 +43,6 @@ javac.debug: off
-runee: JavaSE-1.6
-runbundles: org.apache.felix.gogo.command,\
org.apache.felix.gogo.runtime,\
- org.apache.felix.gogo.shell
\ No newline at end of file
+ org.apache.felix.gogo.shell
+-runproperties: agent.controller.syncdelay=1,\
+ agent.logging.level=DEBUG
\ No newline at end of file
Modified: ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java?rev=1518229&r1=1518228&r2=1518229&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java (original)
+++ ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java Wed Aug 28 14:52:59 2013
@@ -46,17 +46,14 @@ import org.osgi.service.deploymentadmin.
/**
* Default configurable controller
- *
*/
public class DefaultController extends ComponentBase implements Runnable {
- public static final String COMPONENT_IDENTIFIER = "controller";
-
private volatile ScheduledFuture<?> m_scheduledFuture;
private volatile UpdateInstaller m_updateInstaller;
public DefaultController() {
- super(COMPONENT_IDENTIFIER);
+ super("controller");
}
@Override
Modified: ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/updater/Activator.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/updater/Activator.java?rev=1518229&r1=1518228&r2=1518229&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/updater/Activator.java (original)
+++ ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/updater/Activator.java Wed Aug 28 14:52:59 2013
@@ -31,11 +31,10 @@ import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
/**
- * This class is dynamically deployed as part of the updater bundle that executes the
- * update of the management agent. It is both the bundle activator and the interface and
- * implementation of a service that is published and invoked by the management agent.
- * Care was taken to not create import dependencies on anything other than the core
- * framework. Also, no inner classes are used, to keep all the code in a single class file.
+ * This class is dynamically deployed as part of the updater bundle that executes the update of the management agent. It
+ * is both the bundle activator and the interface and implementation of a service that is published and invoked by the
+ * management agent. Care was taken to not create import dependencies on anything other than the core framework. Also,
+ * no inner classes are used, to keep all the code in a single class file.
*/
public class Activator implements BundleActivator, Runnable {
private static final int BUFFER_SIZE = 4096;
@@ -56,7 +55,7 @@ public class Activator implements Bundle
@Override
public void stop(BundleContext context) throws Exception {
}
-
+
public void update(Bundle agent, InputStream oldStream, InputStream newStream) throws IOException {
m_updaterThread = new Thread(this, "Apache ACE Management Agent Updater");
m_agent = agent;
@@ -66,7 +65,7 @@ public class Activator implements Bundle
m_newStream = new FileInputStream(m_newFile);
m_updaterThread.start();
}
-
+
public void copy(InputStream in, OutputStream out) throws IOException {
byte[] buffer = new byte[BUFFER_SIZE];
int length;
@@ -79,14 +78,16 @@ public class Activator implements Bundle
try {
in.close();
}
- catch (IOException e) {}
+ catch (IOException e) {
+ }
try {
out.close();
}
- catch (IOException e) {}
+ catch (IOException e) {
+ }
}
}
-
+
@Override
public void run() {
try {
@@ -96,6 +97,7 @@ public class Activator implements Bundle
try {
m_agent.update(m_oldStream);
m_agent.start();
+ // FIXME we should probable refresh?
}
catch (BundleException e1) {
// at this point we simply give up