Raymond,

I've wondered that before too.  Your case 2 would have been answered by the
SCA spec if the @Reference annotation were defined to be, annotated itself
with:
java.lang.annotation.Inherited.    Since it's not annotated, I'm not sure
what to think from the SCA perspective, (though it's clear what the Java
lang perspective is).


On 3/23/07, Raymond Feng <[EMAIL PROTECTED]> wrote:

Hi,

If I have component implementation class like this:

Case 1:
public class MyServiceImpl implements MyService {
    private YourService yourService;

    public void setYourService(YourService yourService) {
        this.yourService = yourService;
    }
}

public interface MyService {
    @Reference
    void setYourService(YourService yourService);
}

Q1: Should "yourService" be treated as a reference?

Case 2:
public class MyServiceImpl extends MyServiceBaseImpl {
    public void setYourService(YourService yourService) {
        super.setYourService(yourService);
        // Do addtional things here
    }
}

public class MyServiceBaseImpl {
    protected YourService yourService;

    @Reference
    public void setYourService(YourService yourService) {
        this.yourService = yourService;
    }
}

Q2: Should "yourService" be treated as a reference?

Am I crazy?

Thanks,
Raymond

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to