public class OSGiClassLoadingStrategy extends java.lang.Object implements ClassLoadingStrategy
ClassLoadingStrategy
implementation in a full-blown OSGi-based runtime.
It supports dynamic actor class updates through OSGi's great dynamism based on micro-services.
This dynamism is obtained by delegating the class loading to the registered implementations of
ModelElementClassProvider
and ActorOrientedClassProvider
.
Constructor and Description |
---|
OSGiClassLoadingStrategy() |
Modifier and Type | Method and Description |
---|---|
boolean |
addActorOrientedClassProvider(ActorOrientedClassProvider classProvider)
Adds the given provider to the set of registered ActorOrientedClassProviders.
|
boolean |
addModelElementClassProvider(ModelElementClassProvider classProvider)
Add the given provider to the set of registered
ModelElementClassProviders.
|
void |
clearActorOrientedClassProviders()
Clear the set of registered ActorOrientedClassProviders.
|
void |
clearModelElementClassProviders()
Clears the set of registered ModelElementClassProviders.
|
CompositeEntity |
loadActorOrientedClass(java.lang.String className,
VersionSpecification versionSpec)
Load an actor-oriented class, which is typically a .moml file.
|
java.lang.Class<?> |
loadJavaClass(java.lang.String className,
VersionSpecification versionSpec)
Load a Java class.
|
boolean |
removeActorOrientedClassProvider(ActorOrientedClassProvider classProvider)
Removes the given provider from the set of registered ActorOrientedClassProviders.
|
boolean |
removeModelElementClassProvider(ModelElementClassProvider classProvider)
Remove the given provider from the set of registered
ModelElementClassProviders.
|
public java.lang.Class<?> loadJavaClass(java.lang.String className, VersionSpecification versionSpec) throws java.lang.ClassNotFoundException
loadJavaClass
in interface ClassLoadingStrategy
className
- The namee of the class.versionSpec
- The versionjava.lang.ClassNotFoundException
- If the class is not found.public CompositeEntity loadActorOrientedClass(java.lang.String className, VersionSpecification versionSpec) throws java.lang.ClassNotFoundException
loadActorOrientedClass
in interface ClassLoadingStrategy
className
- The namee of the class.versionSpec
- The versionjava.lang.ClassNotFoundException
- If the class is not found.public boolean addModelElementClassProvider(ModelElementClassProvider classProvider)
classProvider
- should be not-nulljava.lang.IllegalArgumentException
- when the given provider is nullpublic boolean removeModelElementClassProvider(ModelElementClassProvider classProvider)
classProvider
- should be not-nulljava.lang.IllegalArgumentException
- when the given provider is nullpublic void clearModelElementClassProviders()
public boolean addActorOrientedClassProvider(ActorOrientedClassProvider classProvider)
classProvider
- should be not-nulljava.lang.IllegalArgumentException
- when the given provider is nullpublic boolean removeActorOrientedClassProvider(ActorOrientedClassProvider classProvider)
classProvider
- should be not-nulljava.lang.IllegalArgumentException
- when the given provider is nullpublic void clearActorOrientedClassProviders()