ECF Core Startup

org.eclipse.ecf.startup

0.9.0

ECF Core Startup Extension Point. This extension point (org.eclipse.ecf.startup) allows other bundles to have arbitrary code run upon ECF startup. Note that extensions will be run when the ECF core bundle (ID: org.eclipse.ecf) is started by the runtime, not necessarily upon platform startup. Of course, if the org.eclipse.ecf bundle is started at platform startup, then extensions of this extension point will also be run.

<!ELEMENT extension (ecfstart)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT ecfstart (property*)>

<!ATTLIST ecfstart

class CDATA #REQUIRED

name  CDATA #IMPLIED>


Here is an example usage of this extension point:

<extension point=

"org.eclipse.ecf.startup"

>

<ecfstart class=

"org.eclipse.ecf.example.collab.start.CollabStart"

/>

</extension>

Note that the CollabStart class must implement the org.eclipse.ecf.start.IECFStart interface. Here's an example implementation class:
public class CollabStart implements IECFStart {
 Discovery discovery = null;
 public IStatus startup(IProgressMonitor monitor) {
  try {
   AccountStart as = new AccountStart();
   as.loadConnectionDetailsFromPreferenceStore();
   Collection c = as.getConnectionDetails();
   for (Iterator i = c.iterator(); i.hasNext();) {
    startConnection((ConnectionDetails) i.next());
   }
  } catch (Exception e) {
   return new Status(IStatus.ERROR, ClientPlugin.PLUGIN_ID, 200,
     "Exception in starting connection", e);
  }
  return new Status(IStatus.OK, ClientPlugin.PLUGIN_ID, 100, "OK", null);
 }
 private void startConnection(ConnectionDetails details) throws Exception {
  CollabClient client = new CollabClient();
  //ClientPlugin.log("ECF: Autostarting containerType="+details.getContainerType()+",uri="+details.getTargetURI()+",nickname="+details.getNickname());
  client.createAndConnectClient(details.getContainerType(), details
    .getTargetURI(), details.getNickname(), details.getPassword(),
    ResourcesPlugin.getWorkspace().getRoot());
 }
}

The API for the org.eclipse.ecf.startup extension point is provided by the org.eclipse.ecf.startup.IECFStartup interface:
/**
 * Interface that must be implemented by extensions of the org.eclipse.ecf.start
 * extension point. Such extensions will have their start method called by a new
 * Job upon ECF startup.
 */
public interface IECFStart {
 /**
  * Start ECF client or server.
  * 
  * @return IStatus the status of the start
  * @throws ECFStartException
  *             if some exception thrown during start
  */
 public IStatus startup(IProgressMonitor monitor);
}

No implementation supplied for this extensinion point.