Author: julien(a)jboss.com
Date: 2006-11-30 02:43:40 -0500 (Thu, 30 Nov 2006)
New Revision: 5745
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PersistentPortalObjectContainer.java
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/TransientPortalObjectContainer.java
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectContainer.java
Log:
minor javadoc improvement
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PersistentPortalObjectContainer.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PersistentPortalObjectContainer.java 2006-11-29
16:35:29 UTC (rev 5744)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PersistentPortalObjectContainer.java 2006-11-30
07:43:40 UTC (rev 5745)
@@ -203,20 +203,21 @@
return this;
}
- public void createContext()
+ public boolean createContext()
{
try
{
- createContextIfNotExist();
+ return createContextIfNotExist();
}
catch (Exception e)
{
- log.error("", e);
+ log.error("Was not able to create root context", e);
+ return false;
}
}
/** todo : use AOP for tx demarcation. */
- public void createContextIfNotExist() throws Exception
+ public boolean createContextIfNotExist() throws Exception
{
log.debug("Detecting the existence of the portal object root context");
Session session = sessionFactory.getCurrentSession();
@@ -238,10 +239,12 @@
//
log.info("Created portal object root context");
+ return true;
}
else
{
log.debug("Portal object root context has been found");
+ return false;
}
}
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/TransientPortalObjectContainer.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/TransientPortalObjectContainer.java 2006-11-29
16:35:29 UTC (rev 5744)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/TransientPortalObjectContainer.java 2006-11-30
07:43:40 UTC (rev 5745)
@@ -65,12 +65,19 @@
};
}
- public void createContext()
+ public boolean createContext()
{
+ if (root != null)
+ {
+ return false;
+ }
+
+ //
root = new ObjectNode(ctx, "", "");
ContextImpl ctx = new ContextImpl();
root.setObject(ctx);
ctx.setObjectNode(root);
+ return true;
}
/** @see PortalObjectContainer#getAuthorizationDomain() */
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectContainer.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectContainer.java 2006-11-29
16:35:29 UTC (rev 5744)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectContainer.java 2006-11-30
07:43:40 UTC (rev 5745)
@@ -32,15 +32,32 @@
*/
public interface PortalObjectContainer
{
- /** Create the root context. */
- void createContext();
+ /**
+ * Create the root context
+ *
+ * @return true if the context was created
+ */
+ boolean createContext();
- /** Return a container object. */
- PortalObject getObject(String id);
+ /**
+ * Return a container object.
+ *
+ * @return the specified portal object
+ * @throws IllegalArgumentException if the id is null
+ */
+ PortalObject getObject(String id) throws IllegalArgumentException;
- /** Return the root context of this container. */
+ /**
+ * Return the root context of this container.
+ *
+ * @return the root context
+ */
Context getContext();
- /** Get the authorization domain */
+ /**
+ * Get the authorization domain.
+ *
+ * @return the authorization domain
+ */
AuthorizationDomain getAuthorizationDomain();
}
Show replies by date