Ok. Well, it seems that I have a lack of knowledge about this component
stuff. I printed out the serviceManager variable and it is null.
So why? How does my class get an instance of ServiceManager. Who must
call service(ServiceManager serviceManager) on it?
####MyExampleClass
public class Example implements Serviceable {
private ServiceManager serviceManager = null;
public Example() {}
public Hashtable getParts() {
Collection partCollection = new ArrayList();
Hashtable parts = new Hashtable();
DataAccessorInt dataAccessor = null;
try {
System.out.println("Example: getParts() - try LookUp"+
serviceManager);
dataAccessor = (DataAccessorInt)
serviceManager.lookup(DataAccessorInt.ROLE);
System.out.println("Example: LookedUp...");
partCollection = dataAccessor.getAllParts();
...
return parts;
}catch(ServiceException e){
System.out.println("Example: "+e);
return parts;
}finally{
System.out.println("Example: Releasing component...");
if(dataAccessor != null) {
serviceManager.release(dataAccessor);
}
}
}
public void service(ServiceManager serviceManager) throws
ServiceException {
this.serviceManager = serviceManager;
}
}
###END MyExampleClass
Thx for any help.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]