You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Peter Neubauer (JIRA)" <ji...@apache.org> on 2006/06/20 11:44:29 UTC
[jira] Created: (FELIX-82) Dep Manager does not handle inherited
callback methods right
Dep Manager does not handle inherited callback methods right
------------------------------------------------------------
Key: FELIX-82
URL: http://issues.apache.org/jira/browse/FELIX-82
Project: Felix
Type: Bug
Components: Dependency Manager
Reporter: Peter Neubauer
This does not work for inherited classes as the reflection jsut works for the current type. In order to be abelt o define callback even in e.g. Abstract classes, one needs to go up the hirarchy in order to find these methods.
/peter
ServiceDependency
...
invokeCallbackMethod
private void invokeCallbackMethod( Object instance, String methodName,
ServiceReference reference, Object service )
throws NoSuchMethodException
{
Method method = null;
Class clazz = instance.getClass();
AccessibleObject.setAccessible( clazz.getDeclaredMethods(), true );
try
{
try
{
method = clazz.getDeclaredMethod( methodName, new Class[] {
ServiceReference.class, Object.class } );
method.invoke( instance, new Object[] { reference, service } );
}
catch ( NoSuchMethodException e )
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Closed: (FELIX-82) Dep Manager does not handle inherited
callback methods right
Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-82?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Richard S. Hall closed FELIX-82.
--------------------------------
> Dep Manager does not handle inherited callback methods right
> ------------------------------------------------------------
>
> Key: FELIX-82
> URL: https://issues.apache.org/jira/browse/FELIX-82
> Project: Felix
> Issue Type: Bug
> Components: Dependency Manager
> Reporter: Peter Neubauer
> Assigned To: Marcel Offermans
> Fix For: 0.8.0
>
>
> This does not work for inherited classes as the reflection jsut works for the current type. In order to be abelt o define callback even in e.g. Abstract classes, one needs to go up the hirarchy in order to find these methods.
> /peter
> ServiceDependency
> ...
> invokeCallbackMethod
> private void invokeCallbackMethod( Object instance, String methodName,
> ServiceReference reference, Object service )
> throws NoSuchMethodException
> {
> Method method = null;
> Class clazz = instance.getClass();
> AccessibleObject.setAccessible( clazz.getDeclaredMethods(), true );
> try
> {
> try
> {
> method = clazz.getDeclaredMethod( methodName, new Class[] {
> ServiceReference.class, Object.class } );
> method.invoke( instance, new Object[] { reference, service } );
> }
> catch ( NoSuchMethodException e )
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-82) Dep Manager does not handle inherited
callback methods right
Posted by "Peter Neubauer (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/FELIX-82?page=comments#action_12416874 ]
Peter Neubauer commented on FELIX-82:
-------------------------------------
Sorry for the spelling, should be
This does not work for inherited classes as the reflection just works for the current type. In order to be abel to define callback even in e.g. Abstract classes, one needs to go up the hierarchy in order to find these methods.
/peter
> Dep Manager does not handle inherited callback methods right
> ------------------------------------------------------------
>
> Key: FELIX-82
> URL: http://issues.apache.org/jira/browse/FELIX-82
> Project: Felix
> Type: Bug
> Components: Dependency Manager
> Reporter: Peter Neubauer
>
> This does not work for inherited classes as the reflection jsut works for the current type. In order to be abelt o define callback even in e.g. Abstract classes, one needs to go up the hirarchy in order to find these methods.
> /peter
> ServiceDependency
> ...
> invokeCallbackMethod
> private void invokeCallbackMethod( Object instance, String methodName,
> ServiceReference reference, Object service )
> throws NoSuchMethodException
> {
> Method method = null;
> Class clazz = instance.getClass();
> AccessibleObject.setAccessible( clazz.getDeclaredMethods(), true );
> try
> {
> try
> {
> method = clazz.getDeclaredMethod( methodName, new Class[] {
> ServiceReference.class, Object.class } );
> method.invoke( instance, new Object[] { reference, service } );
> }
> catch ( NoSuchMethodException e )
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Resolved: (FELIX-82) Dep Manager does not handle inherited
callback methods right
Posted by "Marcel Offermans (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/FELIX-82?page=all ]
Marcel Offermans resolved FELIX-82:
-----------------------------------
Fix Version: 0.8.0
Resolution: Fixed
Extended the method to keep searching superclasses until a valid callback method is found.
> Dep Manager does not handle inherited callback methods right
> ------------------------------------------------------------
>
> Key: FELIX-82
> URL: http://issues.apache.org/jira/browse/FELIX-82
> Project: Felix
> Type: Bug
> Components: Dependency Manager
> Reporter: Peter Neubauer
> Assignee: Marcel Offermans
> Fix For: 0.8.0
>
> This does not work for inherited classes as the reflection jsut works for the current type. In order to be abelt o define callback even in e.g. Abstract classes, one needs to go up the hirarchy in order to find these methods.
> /peter
> ServiceDependency
> ...
> invokeCallbackMethod
> private void invokeCallbackMethod( Object instance, String methodName,
> ServiceReference reference, Object service )
> throws NoSuchMethodException
> {
> Method method = null;
> Class clazz = instance.getClass();
> AccessibleObject.setAccessible( clazz.getDeclaredMethods(), true );
> try
> {
> try
> {
> method = clazz.getDeclaredMethod( methodName, new Class[] {
> ServiceReference.class, Object.class } );
> method.invoke( instance, new Object[] { reference, service } );
> }
> catch ( NoSuchMethodException e )
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Assigned: (FELIX-82) Dep Manager does not handle inherited
callback methods right
Posted by "Marcel Offermans (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/FELIX-82?page=all ]
Marcel Offermans reassigned FELIX-82:
-------------------------------------
Assign To: Marcel Offermans
> Dep Manager does not handle inherited callback methods right
> ------------------------------------------------------------
>
> Key: FELIX-82
> URL: http://issues.apache.org/jira/browse/FELIX-82
> Project: Felix
> Type: Bug
> Components: Dependency Manager
> Reporter: Peter Neubauer
> Assignee: Marcel Offermans
>
> This does not work for inherited classes as the reflection jsut works for the current type. In order to be abelt o define callback even in e.g. Abstract classes, one needs to go up the hirarchy in order to find these methods.
> /peter
> ServiceDependency
> ...
> invokeCallbackMethod
> private void invokeCallbackMethod( Object instance, String methodName,
> ServiceReference reference, Object service )
> throws NoSuchMethodException
> {
> Method method = null;
> Class clazz = instance.getClass();
> AccessibleObject.setAccessible( clazz.getDeclaredMethods(), true );
> try
> {
> try
> {
> method = clazz.getDeclaredMethod( methodName, new Class[] {
> ServiceReference.class, Object.class } );
> method.invoke( instance, new Object[] { reference, service } );
> }
> catch ( NoSuchMethodException e )
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira