private ISharedObject createSharedObject(SharedObjectTypeDescription sotypedesc, IChannelListener listener) throws SharedObjectCreateException {
Class clazz;
try {
clazz = Class.forName(sotypedesc.getClassName());
} catch (final ClassNotFoundException e) {
throw new SharedObjectCreateException("No constructor for shared object of class " + sotypedesc.getClassName(), e);
}
Constructor cons = null;
try {
cons = clazz.getDeclaredConstructor(new Class[] {IChannelListener.class});
} catch (final NoSuchMethodException e) {
throw new SharedObjectCreateException("No constructor for shared object of class " + sotypedesc.getClassName(), e);
}
ISharedObject so = null;
try {
so = (ISharedObject) cons.newInstance(new Object[] {listener});
} catch (final Exception e) {
throw new SharedObjectCreateException("Cannot create instance of class " + sotypedesc.getClassName(), e);
}
return so;
}