DZone Forums
Go Back   DZone Forums > Community > Languages & Frameworks > Java
Reload this Page Problem using Declarative Services
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jul 2008
Default Problem using Declarative Services - 07-02-2008, 04:02 PM

Hello everybody,

I am using osgi for my thesis project and i have faced a problem by using declarative services.

Specifically i want to declare a service which refers to another. Here is the source code.

Service Interface :

package admin.service.adjustLight;

import classes.*;

public interface LightAdjustment {
public void adjustLight (Light light);
}

Service Implementation Class :

package admin.service.adjustLight;

import admin.decision.module.*;
import classes.ConsoleMessages;
import classes.Light;

public class LightAdjustmentImpl implements LightAdjustment{

ConsoleMessages consoleMessages = new ConsoleMessages();
static AdjustmentDecision decisionService;

protected void bind(AdjustmentDecision decision) {
System.out.println("A new service was bind");
decisionService=decision;
}

protected void unbind(AdjustmentDecision decision) {
decisionService=null;
}


public void adjustLight(Light light) {
Object object=null;
decisionService.getDecision(object);
}

}

Component Description xml file :

<?xml version="1.0"?>
<component name="L">
<implementation class="admin.service.adjustLight.LightAdjustmentIm pl"/>
<service>
<provide interface="admin.service.adjustLight.LightAdjustme nt"/>
</service>
<reference name="LOG"
interface="admin.decision.module.AdjustmentDecisio n"
bind="bind"
unbind="unbind"
/>
</component>

The problem is that, although my service LightAdjustment is registered, the binding with the reference service AdjustmentDecision is never happened (the message "A new service was bind" is not printed).

I would be very glad if anyone could help me.

Thanks.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
jax-ws, wsimport how to handle dtos in several services? spross Web Services, SOA & ESB 0 11-06-2008 04:18 AM
Programming Web Services with SOAP Rivot Ajax & Javascript 0 08-11-2008 09:43 AM
Declarative Toolbar Action Pouletchu Eclipse 0 08-03-2008 06:08 AM
Web Services Explorer Authentication wmsigep Web Services, SOA & ESB 0 07-09-2008 03:19 PM
problem with OSGi Declarative Services factory component AlexandreSH Java 2 06-05-2008 12:32 PM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com