felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Meschberger (JIRA)" <j...@apache.org>
Subject [jira] Commented: (FELIX-927) Allow bind and unbind methods to receive the service properties
Date Tue, 28 Jul 2009 15:02:14 GMT

    [ https://issues.apache.org/jira/browse/FELIX-927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12736096#action_12736096
] 

Felix Meschberger commented on FELIX-927:
-----------------------------------------

I have applied your patch slightly modified in Rev. 798554. The modification is the replacement
of the BindMedhot.format method with BindMethod.getMethodNamePrefix. I did this to remain
API compatible with Java 1.3.

Do you think it would be possible to merge the way bind/unbind methods are found with the
way the activate/deactivate/modified methods are found  using the same mechanisms ?

> Allow bind and unbind methods to receive the service properties
> ---------------------------------------------------------------
>
>                 Key: FELIX-927
>                 URL: https://issues.apache.org/jira/browse/FELIX-927
>             Project: Felix
>          Issue Type: New Feature
>          Components: Declarative Services (SCR), Specification compliance
>    Affects Versions: scr-1.0.6
>         Environment: OSGi RFC-0134, OSGi R4.2 Early Draft 2 (http://www.osgi.org/download/osgi-4.2-early-draft2.pdf)

>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: scr-1.2.0
>
>         Attachments: FELIX-927.patch
>
>
> A bind or unbind method must have one of the following prototypes:
>     protected void <method-name>(ServiceReference);
>     protected void <method-name>(<parameter-type>);
>     protected void <method-name>(<parameter-type>, Map);
> If the bind or unbind method has the third prototype, then the service object of the
bound service is passed to the method as the first argument and a Map containing the service
properties of the bound service is passed as the second argument. The method's first parameter
type must be assignable from the type specified by the reference's interface attribute. That
is, the service object of the bound service must be castable to the method's first parameter
type.
> When searching for the bind or unbind method to call, SCR must look through the component
implementation class hierarchy. The declared methods of each class are searched for a method
with the specified name that takes one or two parameters. The method is searched for using
the following priority:
> 1.The method takes a single parameter and the type of the parameter is org.osgi.framework.ServiceReference.
> 2.The method takes a single parameter and the type of the parameter is the type specified
by the reference's interface attribute.
> 3.The method takes a single parameter and the type of the parameter is assignable from
the type specified by the reference's interface attribute. If multiple methods match this
rule, this implies the method name is overloaded and SCR may choose any of the methods to
call.
> 4.The method takes two parameters and the type of the first parameter is the type specified
by the reference's interface attribute and the type of the second parameter is java.util.Map
> 5.The method takes two parameters and the type of the first parameter is assignable from
the type specified by the reference's interface attribute and the type of the second parameter
is java.util.Map. If multiple methods match this rule, this implies the method name is overloaded
and SCR may choose any of the methods to call.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message