/** * @see org.carewebframework.api.context.IContextManager#getSharedContext */ @Override public ISharedContext<?> getSharedContext(String className) { try { Class<?> contextClass = Class.forName(className); for (ISharedContext<?> sharedContext : managedContexts) { if (contextClass.isInstance(sharedContext)) { return sharedContext; } } IManagedContext<?> ctx = (IManagedContext<?>) contextClass.newInstance(); registerObject(ctx); return ctx; } catch (Exception e) { throw new ContextException(e.getMessage()); } }