org.ops4j.pax.reflector
Interface RemoteReflector

All Superinterfaces:
Remote
All Known Implementing Classes:
RemoteReflectorImpl

public interface RemoteReflector
extends Remote

The RemoteReflector is not yet ready for usage, since we have some issue in the OSGi environment.

If you really need a RemoteReflector capability, you will need to create your own. See Creating EndPoint on the website for more details (if written by now).


Method Summary
 String extractContainerPart(String objectname)
          Returns the container part of the objectname.
 String extractNamePart(String objectname)
          Returns the Name part of the objectname.
 String getMember(String membername)
          Returns the human readable form of the object instance traversed from the objectname argument.
 String getMemberClassName(String objectname)
          Returns the name of the Class of the member identified by the objectname argument.
 String[] getMemberNames(Object object)
          Returns all the membernames found in the object.
 String[] getMemberNames(String membername)
          Returns all the membernames found in the member identified by membername argument.
 Object getMemberObject(String membername)
          Returns the object of the member by the given membername.
 boolean isMemberSettable(String objectname)
          Checks with the member of the given objectname can be set to a value.
 void setMember(String membername, String value)
          Assigns the value to the member identified by the membername argument.
 void setMemberObject(String membername, Object value)
          Assigns the value to the member identified by the membername argument.
 

Method Detail

getMember

String getMember(String membername)
                 throws ReflectionException,
                        RemoteException
Returns the human readable form of the object instance traversed from the objectname argument.

Parameters:
membername - The name of the object of interested.
Returns:
The toString() value of the member value object.
Throws:
ReflectionException - if the member does not exist.
RemoteException - if a network problem has occurred.

getMemberObject

Object getMemberObject(String membername)
                       throws ReflectionException,
                              RemoteException
Returns the object of the member by the given membername.

Parameters:
membername - The name of the object to traverse to and return.
Returns:
The object that is returned as the value of the member, either by getter, fields or special handling, such as the value of entries of Maps and Collections.
Throws:
ReflectionException - if the member does not exist.
RemoteException - if a network problem has occurred.

setMember

void setMember(String membername,
               String value)
               throws ReflectionException,
                      RemoteException
Assigns the value to the member identified by the membername argument.

Parameters:
membername - The name of the member to be assigned a value.
value - The value to be assigned to the member. For primitives, the value is converted according to normal Java rules, but additionally a fully-qualified classname can be given, in which case the reflector will try to instantiate such class through the default constructor, and if successful assign the instance to the member.
Throws:
ReflectionException - If the value is not assignable to the member type or the member does not exist.
RemoteException - if a network problem has occurred.

setMemberObject

void setMemberObject(String membername,
                     Object value)
                     throws ReflectionException,
                            RemoteException
Assigns the value to the member identified by the membername argument.

Parameters:
membername - The name of the member to be assigned a value.
value - The value to be assigned to the member.
Throws:
ReflectionException - If the value is not assignable to the member type.
RemoteException - if a network problem has occurred.

getMemberNames

String[] getMemberNames(String membername)
                        throws ReflectionException,
                               RemoteException
Returns all the membernames found in the member identified by membername argument.

If the membername is an empty string, all root object names are returned.

Parameters:
membername - The name of the member to query for its members.
Returns:
The members that are found in the object identified by membername.
Throws:
ReflectionException - If the member identified by the membername does not exist.
RemoteException - if a network problem has occurred.

getMemberNames

String[] getMemberNames(Object object)
                        throws RemoteException
Returns all the membernames found in the object.

Parameters:
object - The Java instance to query for its members.
Returns:
The members that are found in the object.
Throws:
RemoteException - if a network problem has occurred.

getMemberClassName

String getMemberClassName(String objectname)
                          throws ReflectionException,
                                 RemoteException
Returns the name of the Class of the member identified by the objectname argument.

Parameters:
objectname - The name of the member to query for its Class.
Returns:
The name of the Class of the named object.
Throws:
ReflectionException - if the named object does not exist.
RemoteException - if a network problem has occurred.

isMemberSettable

boolean isMemberSettable(String objectname)
                         throws ReflectionException,
                                RemoteException
Checks with the member of the given objectname can be set to a value.

Parameters:
objectname - The member to be tested if it can be set by a setMemberObject() method call.
Returns:
true if the object identified by the objectname can be set.
Throws:
ReflectionException - if the objectname does not identify an existing object reference.
RemoteException - if a network problem has occurred.

extractContainerPart

String extractContainerPart(String objectname)
                            throws RemoteException
Returns the container part of the objectname.

This method must correctly return the container part of the full objectname. For instance; getContainerPart( "someRoot.Abc.Def" ), must return "someRoot.Abc", getContainerPart( "someRoot.Abc['Def']" ), must return "someRoot.Abc", and getContainerPart( "someRoot.Abc['Def'].Rst" ), must return "someRoot.Abc['Def']".

Parameters:
objectname - The objectname to be worked upon.
Returns:
The container part of the objectname.
Throws:
RemoteException - if a network problem has occurred.

extractNamePart

String extractNamePart(String objectname)
                       throws RemoteException
Returns the Name part of the objectname.

This method must correctly return the Name part of the full objectname. For instance; getContainerPart( "someRoot.Abc.Def" ), must return "Def", getContainerPart( "someRoot.Abc['Def']" ), must return "['Def']", and getContainerPart( "someRoot.Abc['Def'].Rst" ), must return "Rst".

Parameters:
objectname - The objectname to be worked upon.
Returns:
The name part of the objectname.
Throws:
RemoteException - if a network problem has occurred.


Copyright © 2006-2012 OPS4J - Open Participation Software for Java. All Rights Reserved.