My favorites
|
Sign in
kcode
Sample code projects
Project Home
Downloads
Wiki
Issues
Source
Checkout
|
Browse
|
Changes
|
r74
Source path:
svn
/
trunk
/
osgi
/
HelloWorldSpec
/
client
/
src
/
com
/
extensiblejava
/
hello
/
client
/
HelloConsumer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.extensiblejava.hello.client;
import com.extensiblejava.hello.service.HelloService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;
public class HelloConsumer implements BundleActivator {
private ServiceTracker helloWorldTracker;
public void start(BundleContext context) throws Exception {
helloWorldTracker = new ServiceTracker(context, HelloService.class.getName(), null);
helloWorldTracker.open();
HelloService hello = (HelloService) helloWorldTracker.getService();
if (hello == null) {
System.out.println("Hello service unavailable on HelloConsumer start");
} else {
System.out.println(hello.sayHello());
}
}
public void stop(BundleContext context) {
HelloService hello = (HelloService) helloWorldTracker.getService();
if (hello == null) {
System.out.println("Hello service unavailable on HelloConsumer stop");
} else {
System.out.println(hello.sayGoodbye());
}
helloWorldTracker.close();
}
/*public void setHelloService(HelloService hello) {
this.hello = hello;
}*/
}
Show details
Hide details
Change log
r12
by pragkirk on Mar 18, 2008
Diff
Initial checkin.
Go to:
...nk/osgi/HelloWorldSpec/build.xml
/trunk/osgi/HelloWorldSpec/cache
...loWorldSpec/cache/HelloWorldSpec
...pec/cache/HelloWorldSpec/bundle1
...HelloWorldSpec/bundle1/bundle.id
...Spec/bundle1/bundle.lastmodified
...orldSpec/bundle1/bundle.location
...ldSpec/bundle1/bundle.startlevel
...loWorldSpec/bundle1/bundle.state
...elloWorldSpec/bundle1/version0.0
...ec/bundle1/version0.0/bundle.jar
...Spec/bundle1/version0.0/embedded
...WorldSpec/bundle1/version0.0/lib
...le1/version0.0/revision.location
...pec/cache/HelloWorldSpec/bundle2
...HelloWorldSpec/bundle2/bundle.id
...Spec/bundle2/bundle.lastmodified
...orldSpec/bundle2/bundle.location
...ldSpec/bundle2/bundle.startlevel
...loWorldSpec/bundle2/bundle.state
...elloWorldSpec/bundle2/version0.0
...ec/bundle2/version0.0/bundle.jar
...Spec/bundle2/version0.0/embedded
...WorldSpec/bundle2/version0.0/lib
...le2/version0.0/revision.location
...pec/cache/HelloWorldSpec/bundle3
...HelloWorldSpec/bundle3/bundle.id
...Spec/bundle3/bundle.lastmodified
...orldSpec/bundle3/bundle.location
...ldSpec/bundle3/bundle.startlevel
...loWorldSpec/bundle3/bundle.state
...elloWorldSpec/bundle3/version0.0
...ec/bundle3/version0.0/bundle.jar
...Spec/bundle3/version0.0/embedded
...WorldSpec/bundle3/version0.0/lib
...le3/version0.0/revision.location
...pec/cache/HelloWorldSpec/bundle4
...HelloWorldSpec/bundle4/bundle.id
...Spec/bundle4/bundle.lastmodified
...orldSpec/bundle4/bundle.location
...ldSpec/bundle4/bundle.startlevel
...loWorldSpec/bundle4/bundle.state
...elloWorldSpec/bundle4/version0.0
...ec/bundle4/version0.0/bundle.jar
...Spec/bundle4/version0.0/embedded
...WorldSpec/bundle4/version0.0/lib
...le4/version0.0/revision.location
...pec/cache/HelloWorldSpec/bundle5
...HelloWorldSpec/bundle5/bundle.id
...Spec/bundle5/bundle.lastmodified
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 1230 bytes, 41 lines
View raw file
File properties
svn:executable
Hosted by