public abstract class Component<T> extends Object
Component
wraps a component instance.
You need to declare a subclass of Component
and install it to the
Jaguar container when you need to manage any third party component the
source code is unmodifiable.Constructor and Description |
---|
Component() |
public abstract T instance()
Component#instance()
method returns, but the Component
instance itself. So
Component#instance()
method on a Component
instance
should return the same instance anytime for the component scope consistency.
Example implementation:
public class YourComponent extends Component<YourObject> {
private final YourObject instance;
public YourComponent() {
// Instantiating third party component and caching it.
instance = new YourObject();
}
@Override
public Object instance() {
// Returning the same instance anytime.
return instance;
}
}
Copyright © 2011-2014 Eiichiro Uchiumi. All Rights Reserved.