how do I get a Service instance from a POJO?

2010-10-08 Thread sam lee
Hey, I can get a Service instance from another Service by using: @Reference private MyService myService; But, how can I get a reference to MyService instance from a POJO? Since the POJO will be used in some other service, should I get MyService reference from the service POJO is being use

Re: how do I get a Service instance from a POJO?

2010-10-10 Thread sam lee
rom POJO. I'll google for iPOJO. Thanks. On Sun, Oct 10, 2010 at 1:14 PM, Clement Escoffier < clement.escoff...@gmail.com> wrote: > > On 10.10.2010, at 18:59, Richard S. Hall wrote: > > > On 10/8/10 17:38, sam lee wrote: > >> Hey, > >> >

how can I remotely manage OSGi bundles and components/services?

2010-10-28 Thread sam lee
Is there RESTful API for Felix (Web Console) for managing bundles, components, services? I am trying to write a deployment script that'll uninstall a bundle and install a newer one (or upgrade an existing one). Is there a way to send POST request with a jar? Or, what's the proper way to manage bu

a bundle is at Stopping state.

2010-11-15 Thread sam lee
Hey, I have a bundle that is at Stopping state. I can't find a way to force uninstall it. This is how I installed it in the first place: curl -F"action=install" -F"_noredir_=_noredir_" -F"bundlefi...@foo-1.0.jar" -F"bundlestart=start" -F"bundlestartlevel=20" -F"refreshPackages=true" -u "admin:admi

Re: a bundle is at Stopping state.

2010-11-15 Thread sam lee
the server was in weird state. I had to kill -9 pid... then restart. and it's now Active! On Mon, Nov 15, 2010 at 11:24 AM, sam lee wrote: > Hey, > > I have a bundle that is at Stopping state. I can't find a way to force > uninstall it. > This is how I installed it in t

what is symbolicName?

2010-12-01 Thread sam lee
Using Web Console, I could get information about a bundle through HTTP GET /system/console/bundles/.json The returned json includes a property called "symbolicName" which seems to be constructed using maven groupId and artifactId. symbolicName is also displayed in parenthesis when you visit /system

Download a bundle from felix?

2010-12-01 Thread sam lee
Hey, What's a good way of downloading a bundle from felix? This is what I'm trying to do: - get symbolicName from user - find bundle number (GET /system/console/bundles/.json and find matching symbolicName and get id) - find the bundle under launchpad/felix/bundle/version.0.0/bundle.jar Is th

how can I handle error condition during activate()?

2011-05-16 Thread sam lee
Hey, I have: @Activate private void activate(Map config) { cdnHost = OsgiUtil.toString(config.get(PROP_CDN_HOST), null); if (cdnHost == null) { // Do I throw an Exception here? // I don't want this component to be Activated if cdnHost isn't set.

Re: how can I handle error condition during activate()?

2011-05-23 Thread sam lee
What's DS? Dual Screen? Declarative Service? Dynamic Service? On Mon, May 23, 2011 at 8:44 AM, Peter Kriens wrote: > It is the beauty of DS: Just throw the exception and it ends up in the log! > > Kind regards, > >Peter Kriens > > On 16 mei 2011, at 21:47

Re: Felix maven bundle plugin

2011-05-26 Thread sam lee
can you try this? org.apache.felix maven-bundle-plugin true 2.3.4 FOO,BAR PACKAGES,USED,IN,YOUR,BUNDLE *;resolution:=optional DEPENDENCIES,NOT,IN,FELIX;scope=compile|runtime tru

Re: Felix maven bundle plugin

2011-05-26 Thread sam lee
Yup. It took me the entire day to find that it's resoultion:=optional not resolution=optional :P I cursed almost every second that day. On Thu, May 26, 2011 at 8:36 AM, rgubler2 wrote: > > Hello, > > i added only the following line: > >*;resolution:=optional > > Now it works as expected

how can I get a Component object?

2011-06-02 Thread sam lee
Hey, I am using maven-scr-plugin. I have: @Component(immediate=true) public class Foo { @Reference private Bar bar; } Obviously, when I get Foo instance by calling constructor, new Foo(), bar isn't set. Is there a way to get Foo instance OSGi-way?

Re: how can I get a Component object?

2011-06-02 Thread sam lee
't want to make it a service? > > On Thu, Jun 2, 2011 at 3:02 PM, sam lee wrote: > > Hey, > > > > I am using maven-scr-plugin. > > > > I have: > > > > @Component(immediate=true) > > public class Foo { > >@Reference > &

Re: Felix maven-bundle-plugin transitive dependency issue

2011-06-10 Thread sam lee
*;resolution:=optional freemarker,gwt;scope=compile|runtime you import all (*). resolution:=optional is important!!:= is really importa

Re: Felix maven-bundle-plugin transitive dependency issue

2011-06-10 Thread sam lee
Try it and see. Does it work? I wouldn't try to reason Java complexity, OSGi. On Fri, Jun 10, 2011 at 3:20 PM, wrote: > > > Shamik, > > > > I completely understand how you feel about making bundles out of > non-bundled .jar files. The standard answer is to contact the vendor and > have them mak

Re: Felix maven-bundle-plugin transitive dependency issue

2011-06-10 Thread sam lee
emaining package reference? > > On Fri, Jun 10, 2011 at 12:25 PM, sam lee wrote: > > Try it and see. Does it work? > > > > I wouldn't try to reason Java complexity, OSGi. > > > > On Fri, Jun 10, 2011 at 3:20 PM, wrote: > > > >> > >>