- if (systemExecutor != null)
- systemExecutor.execute(action);
- else
- action.run();
- }
-
- // JCR REPOSITORY (delegated)
- public String getDescriptor(String key) {
- return repository.getDescriptor(key);
- }
-
- public String[] getDescriptorKeys() {
- return repository.getDescriptorKeys();
- }
-
- public Session login() throws LoginException, RepositoryException {
- Session session = repository.login();
- processNewSession(session);
- return session;
- }
-
- public Session login(Credentials credentials, String workspaceName)
- throws LoginException, NoSuchWorkspaceException,
- RepositoryException {
- Session session;
- try {
- session = repository.login(credentials, workspaceName);
- } catch (NoSuchWorkspaceException e) {
- if (autocreateWorkspaces)
- session = createWorkspaceAndLogsIn(credentials, workspaceName);
- else
- throw e;
- }
- processNewSession(session);
- return session;
- }
-
- public Session login(Credentials credentials) throws LoginException,
- RepositoryException {
- Session session = repository.login(credentials);
- processNewSession(session);
- return session;
- }
-
- public Session login(String workspaceName) throws LoginException,
- NoSuchWorkspaceException, RepositoryException {
- Session session;
- try {
- session = repository.login(workspaceName);
- } catch (NoSuchWorkspaceException e) {
- if (autocreateWorkspaces)
- session = createWorkspaceAndLogsIn(null, workspaceName);
- else
- throw e;
- }
- processNewSession(session);
- return session;
- }
-
- protected synchronized void processNewSession(Session session) {
- try {
- NamespaceHelper namespaceHelper = new NamespaceHelper(session);
- namespaceHelper.registerNamespaces(namespaces);
- } catch (Exception e) {
- throw new ArgeoException("Cannot process new session", e);
- }
- }
-
- /**
- * Logs in to the default workspace, creates the required workspace, logs
- * out, logs in to the required workspace.
- */
- protected Session createWorkspaceAndLogsIn(Credentials credentials,
- String workspaceName) throws RepositoryException {
- if (workspaceName == null)
- throw new ArgeoException("No workspace specified.");
- Session session = repository.login(credentials);
- session.getWorkspace().createWorkspace(workspaceName);
- session.logout();
- return repository.login(credentials, workspaceName);
- }
-
- public void setResourceLoader(ResourceLoader resourceLoader) {
- this.resourceLoader = resourceLoader;
- }
-
- public boolean isStandardDescriptor(String key) {
- return repository.isStandardDescriptor(key);
- }
-
- public boolean isSingleValueDescriptor(String key) {
- return repository.isSingleValueDescriptor(key);
- }
-
- public Value getDescriptorValue(String key) {
- return repository.getDescriptorValue(key);
- }
-
- public Value[] getDescriptorValues(String key) {
- return repository.getDescriptorValues(key);
- }
-
- // BEANS METHODS
- public void setHomeDirectory(String homeDirectory) {