Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Help starting EventAdmin service!
Help starting EventAdmin service! [message #68383] Wed, 31 May 2006 11:53 Go to next message
Martin Holmes is currently offline Martin HolmesFriend
Messages: 79
Registered: July 2009
Member
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>&nbsp;&nbsp;&nbsp;&nbsp; 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>&nbsp;&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3D"Courier New">public class =
Activator=20
implements BundleActivator {<BR>&nbsp;private =
EventRedeliverer&nbsp;&nbsp;&nbsp;=20
_eventRedeliverer=3D null;<BR>&nbsp;private ServiceRegistration =
_eventAdminService=20
=3D null;<BR>&nbsp;public void start(BundleContext bundleContext)=20
{<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;_eventAdminService =3D=20
bundleContext.registerService("org.osgi.service.event.EventAdmin ",=20
//$NON-NLS-1$<BR>&nbsp;&nbsp;&nbsp;&nbsp;new=20
EventAdminImpl(bundleContext),null);<BR>&nbsp;&nbsp;_eventRedeliverer&nbs=
p; =3D=20
new=20
EventRedeliverer(bundleContext);<BR>&nbsp;&nbsp;_eventRedeliverer.open();=
<BR>&nbsp;&nbsp;<BR>&nbsp;}<BR>&nbsp;<BR >&nbsp;public=20
void stop(BundleContext bundleContext)=20
{<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;_eventRedeliverer.close(); <BR>&nbsp;&nbs=
p;_eventRedeliverer=3Dnull;<BR>&nbsp;&nbsp;_eventAdminService.unregister(=
);<BR>&nbsp;&nbsp;_eventAdminService=3Dnull;<BR>&nbsp;&nbsp;&nbsp; <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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Can anyone help?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thank in advance</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>martin</DIV></FONT>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<P><FONT face=3DArial size=3D2></FONT>&nbsp;</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 17:03 Go to previous message
Martin Holmes is currently offline Martin HolmesFriend
Messages: 79
Registered: July 2009
Member
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" &lt;martincanbe@hotmail.com&gt; =
wrote in=20
message news:e5k0do$ro5$1@utils.eclipse.org...<BR>Hi=20
all<BR>&nbsp;&nbsp;&nbsp;&nbsp; I have obtained the equinox =
implementation from=20
the Eclipse equinox osgi downloads page.=20
eclipse-equinox-SDK-I20060526-0010.zip&nbsp; <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>&nbsp;private EventRedeliverer&nbsp;&nbsp;&nbsp;=20
_eventRedeliverer=3D null;<BR>&nbsp;private ServiceRegistration =
_eventAdminService=20
=3D null;<BR>&nbsp;public void start(BundleContext bundleContext) =
{<BR>&nbsp;=20
<BR>&nbsp; _eventAdminService =3D=20
bundleContext.registerService("org.osgi.service.event.EventAdmin ",=20
//$NON-NLS-1$<BR>&nbsp;&nbsp;&nbsp; new=20
EventAdminImpl(bundleContext),null);<BR>&nbsp; _eventRedeliverer&nbsp; =
=3D new=20
EventRedeliverer(bundleContext);<BR>&nbsp; =
_eventRedeliverer.open();<BR>&nbsp;=20
<BR>&nbsp;}<BR>&nbsp;<BR>&nbsp;public void stop(BundleContext =
bundleContext)=20
{<BR>&nbsp; <BR>&nbsp; _eventRedeliverer.close();<BR>&nbsp;=20
_eventRedeliverer=3Dnull;<BR>&nbsp; =
_eventAdminService.unregister();<BR>&nbsp;=20
_eventAdminService=3Dnull;<BR>&nbsp;&nbsp; <BR>&nbsp;}<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--
Previous Topic:getting folders in server plguins on contextPath
Next Topic:Equinox UserAdmin Implementation: Configurable Location for User Admin Data
Goto Forum:
  


Current Time: Sat Apr 27 03:04:46 GMT 2024

Powered by FUDForum. Page generated in 0.03062 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top