<!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>
Note that the CollabStart class must implement the org.eclipse.ecf.start.IECFStart interface. Here's an example implementation class:<extension point=
"org.eclipse.ecf.startup"
>
<ecfstart class=
"org.eclipse.ecf.example.collab.start.CollabStart"
/>
</extension>
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()); } }
/** * 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); }
Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Composent, Inc. - initial API and implementation