|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.osgi.internal.baseadaptor.weaving.WovenClassImpl
public final class WovenClassImpl
| Constructor Summary | |
|---|---|
WovenClassImpl(String className,
byte[] bytes,
BundleEntry entry,
ProtectionDomain domain,
BundleLoader loader,
ServiceRegistry registry,
Map<ServiceRegistration<?>,Boolean> blacklist)
|
|
| Method Summary | |
|---|---|
void |
call(Object hook,
ServiceRegistration<?> hookRegistration)
Call the specified hook. |
BundleWiring |
getBundleWiring()
Returns the bundle wiring whose class loader will define the woven class. |
byte[] |
getBytes()
Returns the class file bytes to be used to define the named class. |
String |
getClassName()
Returns the fully qualified name of the class being woven. |
Class<?> |
getDefinedClass()
Returns the class associated with this woven class. |
List<String> |
getDynamicImports()
Returns the list of dynamic import package descriptions to add to the bundle wiring for this woven class. |
ServiceRegistration<?> |
getErrorHook()
|
String |
getHookClassName()
Return the class name of the hook type supported by this hook context. |
String |
getHookMethodName()
Return the hook method name called by this hook context. |
ProtectionDomain |
getProtectionDomain()
Returns the protection domain to which the woven class will be assigned when it is defined. |
boolean |
isWeavingComplete()
Returns whether weaving is complete in this woven class. |
void |
setBytes(byte[] newBytes)
Set the class file bytes to be used to define the named class. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public WovenClassImpl(String className,
byte[] bytes,
BundleEntry entry,
ProtectionDomain domain,
BundleLoader loader,
ServiceRegistry registry,
Map<ServiceRegistration<?>,Boolean> blacklist)
| Method Detail |
|---|
public byte[] getBytes()
WovenClassnamed class.
While weaving is not complete, this method
returns a reference to the class files byte array contained in this
object. After weaving is complete, this
object becomes effectively immutable and a copy of the class file byte
array is returned.
getBytes in interface WovenClassnamed class.public void setBytes(byte[] newBytes)
WovenClassnamed class. This method must not be
called outside invocations of the weave method by the framework.
While weaving is not complete, this method
replaces the reference to the array contained in this object with the
specified array. After weaving is complete,
this object becomes effectively immutable and this method will throw an
IllegalStateException.
setBytes in interface WovenClassnewBytes - The new classfile that will be used to define the
named class. The specified array
is retained by this object and the caller must not modify the
specified array.public List<String> getDynamicImports()
WovenClassbundle wiring for this woven class. Changes
made to the returned list will be visible to later weaving hooks called with this object. The returned list must not be
modified outside invocations of the weave method by the framework.
After weaving is complete, this object
becomes effectively immutable and the returned list will be unmodifiable.
If the Java runtime environment supports permissions, the caller must
have AdminPermission[bundle,WEAVE] to modify the returned list.
getDynamicImports in interface WovenClassIllegalArgumentException if a
malformed dynamic import package description is added.public boolean isWeavingComplete()
WovenClassweaving hook is called and
the class is defined.
After weaving is complete, this object becomes effectively immutable.
isWeavingComplete in interface WovenClasstrue weaving is complete, false otherwise.public String getClassName()
WovenClass
getClassName in interface WovenClasspublic ProtectionDomain getProtectionDomain()
WovenClass
getProtectionDomain in interface WovenClassnull if no protection domain will
be assigned.public Class<?> getDefinedClass()
WovenClassnull until weaving is
complete. Once weaving is complete, this
method will return the class object.
getDefinedClass in interface WovenClassnull if
weaving is not complete or the class definition failed.public BundleWiring getBundleWiring()
WovenClass
getBundleWiring in interface WovenClass
public void call(Object hook,
ServiceRegistration<?> hookRegistration)
throws Exception
HookContext
call in interface HookContexthook - The hook object to call. The hook object must be of the type
supported by this hook context. If it is not, then this method will
simply return.hookRegistration - the registration for the hook object
Exception - An exception thrown by the hook object.public String getHookMethodName()
HookContext
getHookMethodName in interface HookContextpublic String getHookClassName()
HookContext
getHookClassName in interface HookContextpublic String toString()
toString in class Objectpublic ServiceRegistration<?> getErrorHook()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||