Help starting EventAdmin service! [message #68383] |
Wed, 31 May 2006 07:53  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_003F_01C684B1.2A05AA50
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi all
I have obtained the equinox implementation from the Eclipse equinox =
osgi downloads page. eclipse-equinox-SDK-I20060526-0010.zip =20
I am trying to work out how to start the EventAdmin service and was =
wondering if anyone can help?
Rather than register the Admin service I noticed there is an Activator =
class that does this the job;
package org.eclipse.equinox.event;
import org.eclipsei.equinox.event.mapper.EventRedeliverer;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
public class Activator implements BundleActivator {
private EventRedeliverer _eventRedeliverer=3D null;
private ServiceRegistration _eventAdminService =3D null;
public void start(BundleContext bundleContext) {
=20
_eventAdminService =3D =
bundleContext.registerService("org.osgi.service.event.EventAdmin ", =
//$NON-NLS-1$
new EventAdminImpl(bundleContext),null);
_eventRedeliverer =3D new EventRedeliverer(bundleContext);
_eventRedeliverer.open();
=20
}
=20
public void stop(BundleContext bundleContext) {
=20
_eventRedeliverer.close();
_eventRedeliverer=3Dnull;
_eventAdminService.unregister();
_eventAdminService=3Dnull;
=20
}
I just don't know how to get this bundle to activate, if I try =
Activator.getPlugin() I get an internal usage warning.=20
Can anyone help?
thank in advance
martin
------=_NextPart_000_003F_01C684B1.2A05AA50
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1543" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi all</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> I have =
obtained the=20
equinox implementation from the Eclipse equinox osgi downloads page. =
</FONT><A=20
href=3D" http://download.eclipse.org/eclipse/equinox/drops/I20060526- 0010/=
download.php?dropFile=3Declipse-equinox-SDK-I20060526-0010.z ip "><FONT=20
face=3DArial =
size=3D2>eclipse-equinox-SDK-I20060526-0010.zip</FONT></A ><FONT=20
face=3DArial size=3D2> </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I am trying to work out how to start =
the EventAdmin=20
service and was wondering if anyone can help?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Rather than register the Admin service =
I noticed=20
there is an Activator class that does this the job;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>package=20
org.eclipse.equinox.event;</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>import=20
org.eclipsei.equinox.event.mapper.EventRedeliverer;<BR>import=20
org.osgi.framework.BundleActivator;<BR>import=20
org.osgi.framework.BundleContext;<BR>import=20
org.osgi.framework.ServiceRegistration;</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3D"Courier New">public class =
Activator=20
implements BundleActivator {<BR> private =
EventRedeliverer =20
_eventRedeliverer=3D null;<BR> private ServiceRegistration =
_eventAdminService=20
=3D null;<BR> public void start(BundleContext bundleContext)=20
{<BR> <BR> _eventAdminService =3D=20
bundleContext.registerService("org.osgi.service.event.EventAdmin ",=20
//$NON-NLS-1$<BR> new=20
EventAdminImpl(bundleContext),null);<BR> _eventRedeliverer&nbs=
p; =3D=20
new=20
EventRedeliverer(bundleContext);<BR> _eventRedeliverer.open();=
<BR> <BR> }<BR> <BR > public=20
void stop(BundleContext bundleContext)=20
{<BR> <BR> _eventRedeliverer.close(); <BR> &nbs=
p;_eventRedeliverer=3Dnull;<BR> _eventAdminService.unregister(=
);<BR> _eventAdminService=3Dnull;<BR> <BR>&nb=
sp;}</FONT><BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I just don't know how to get this =
bundle to=20
activate, if I try Activator.getPlugin() I get an internal usage =
warning.=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Can anyone help?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>thank in advance</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>martin</DIV></FONT>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<P><FONT face=3DArial size=3D2></FONT> </P></BODY></HTML>
------=_NextPart_000_003F_01C684B1.2A05AA50--
|
|
|
Re: Help starting EventAdmin service! [message #68403 is a reply to message #68383] |
Wed, 31 May 2006 13:03  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_009A_01C684DC.7F94AF40
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Ok, I managed to solve it!=20
within the configuration/config.ini I added the bundle to the property =
osgi.bundles=3D
osgi.bundles=3Dorg.eclipse.equinox.common@2:start, =
org.eclipse.equinox.event@start,org.eclipse.update.configurator@3:start, =
org.eclipse.core.runtime@start
and then had to use -clean to stop the error message.
org.osgi.framework.BundleException: Bundle "org.eclipse.equinox.event" =
version "1.0.0.v20060510" has already been installed from: =
update@plugins/org.eclipse.equinox.event_1.0.0.v20060510.jar
------------------------------------------------------------ -------------=
-------
"Martin Holmes" <martincanbe@hotmail.com> wrote in message =
news:e5k0do$ro5$1@utils.eclipse.org...
Hi all
I have obtained the equinox implementation from the Eclipse equinox =
osgi downloads page. eclipse-equinox-SDK-I20060526-0010.zip =20
I am trying to work out how to start the EventAdmin service and was =
wondering if anyone can help?
Rather than register the Admin service I noticed there is an Activator =
class that does this the job;
package org.eclipse.equinox.event;
import org.eclipsei.equinox.event.mapper.EventRedeliverer;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
public class Activator implements BundleActivator {
private EventRedeliverer _eventRedeliverer=3D null;
private ServiceRegistration _eventAdminService =3D null;
public void start(BundleContext bundleContext) {
=20
_eventAdminService =3D =
bundleContext.registerService("org.osgi.service.event.EventAdmin ", =
//$NON-NLS-1$
new EventAdminImpl(bundleContext),null);
_eventRedeliverer =3D new EventRedeliverer(bundleContext);
_eventRedeliverer.open();
=20
}
=20
public void stop(BundleContext bundleContext) {
=20
_eventRedeliverer.close();
_eventRedeliverer=3Dnull;
_eventAdminService.unregister();
_eventAdminService=3Dnull;
=20
}
I just don't know how to get this bundle to activate, if I try =
Activator.getPlugin() I get an internal usage warning.=20
Can anyone help?
thank in advance
martin
------=_NextPart_000_009A_01C684DC.7F94AF40
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1543" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff background=3D""><FONT face=3DArial size=3D2>Ok, =
I managed to=20
solve it! <BR><BR>within the configuration/config.ini I added the bundle =
to the=20
property=20
osgi.bundles=3D<BR><BR><EM>osgi.bundles</EM>=3Dorg.eclipse.equinox.common=
@2:start,=20
org.eclipse.equinox.event@start,org.eclipse.update.configurator@3:start, =
org.eclipse.core.runtime@start<BR><BR>and then had to use =
<EM>-clean</EM> to=20
stop the error message.<BR><BR>org.osgi.framework.BundleException: =
Bundle=20
"org.eclipse.equinox.event" version "1.0.0.v20060510" has already been =
installed=20
from: =
update@plugins/org.eclipse.equinox.event_1.0.0.v20060510.jar<BR><BR>
<HR>
<BR><BR><BR><BR><BR>"Martin Holmes" <martincanbe@hotmail.com> =
wrote in=20
message news:e5k0do$ro5$1@utils.eclipse.org...<BR>Hi=20
all<BR> I have obtained the equinox =
implementation from=20
the Eclipse equinox osgi downloads page.=20
eclipse-equinox-SDK-I20060526-0010.zip <BR><BR>I am trying to work =
out how=20
to start the EventAdmin service and was wondering if anyone can=20
help?<BR><BR>Rather than register the Admin service I noticed there is =
an=20
Activator class that does this the job;<BR><BR>package=20
org.eclipse.equinox.event;<BR><BR>import=20
org.eclipsei.equinox.event.mapper.EventRedeliverer;<BR>import=20
org.osgi.framework.BundleActivator;<BR>import=20
org.osgi.framework.BundleContext;<BR>import=20
org.osgi.framework.ServiceRegistration;<BR><BR>public class Activator =
implements=20
BundleActivator {<BR> private EventRedeliverer =20
_eventRedeliverer=3D null;<BR> private ServiceRegistration =
_eventAdminService=20
=3D null;<BR> public void start(BundleContext bundleContext) =
{<BR> =20
<BR> _eventAdminService =3D=20
bundleContext.registerService("org.osgi.service.event.EventAdmin ",=20
//$NON-NLS-1$<BR> new=20
EventAdminImpl(bundleContext),null);<BR> _eventRedeliverer =
=3D new=20
EventRedeliverer(bundleContext);<BR> =
_eventRedeliverer.open();<BR> =20
<BR> }<BR> <BR> public void stop(BundleContext =
bundleContext)=20
{<BR> <BR> _eventRedeliverer.close();<BR> =20
_eventRedeliverer=3Dnull;<BR> =
_eventAdminService.unregister();<BR> =20
_eventAdminService=3Dnull;<BR> <BR> }<BR><BR>I just =
don't know=20
how to get this bundle to activate, if I try Activator.getPlugin() I get =
an=20
internal usage warning. <BR><BR>Can anyone help?<BR><BR>thank in=20
advance<BR><BR>martin</FONT></BODY></HTML>
------=_NextPart_000_009A_01C684DC.7F94AF40--
|
|
|
Powered by
FUDForum. Page generated in 0.04309 seconds