JBoss Portal SVN: r8315 - branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2007-09-18 10:00:18 -0400 (Tue, 18 Sep 2007)
New Revision: 8315
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/style.css
Log:
JBPORTAL-1539 Steps in wizard are misaligned...
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/style.css
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/style.css 2007-09-18 11:57:22 UTC (rev 8314)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/style.css 2007-09-18 14:00:18 UTC (rev 8315)
@@ -422,6 +422,11 @@
clear: both;
}
+.admin-ui form {
+ padding:0;
+ margin:0;
+}
+
.admin-ui #selected.wizardStepBox {
background-color: #C8DCC4;
border: 1px solid black;
18 years, 7 months
JBoss Portal SVN: r8314 - in trunk/core-identity: src/bin/portal-identity-war and 4 other directories.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-09-18 07:57:22 -0400 (Tue, 18 Sep 2007)
New Revision: 8314
Modified:
trunk/core-identity/build.xml
trunk/core-identity/src/bin/portal-identity-war/style.css
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java
trunk/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/registerRoles.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/captcha.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/confirm.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/register.xhtml
Log:
- reset registration forms
- mark required fields
Modified: trunk/core-identity/build.xml
===================================================================
--- trunk/core-identity/build.xml 2007-09-18 11:30:28 UTC (rev 8313)
+++ trunk/core-identity/build.xml 2007-09-18 11:57:22 UTC (rev 8314)
@@ -324,8 +324,12 @@
<path refid="junit.junit.classpath"/>
<path refid="jboss.jbossxb.classpath"/>
<path refid="jbossas/core.libs.classpath"/>
+ <path refid="jboss.portal-common.classpath"/>
+ <path refid="jboss.portal-portlet.classpath"/>
+ <path refid="jboss.portal-identity.classpath"/>
<path refid="jboss.portal-jems.classpath"/>
<path refid="jboss.portal-identity.classpath"/>
+ <path refid="jboss.portal-test.classpath"/>
<path refid="oswego.concurrent.classpath" />
<path refid="apache.xerces.classpath"/>
<pathelement location="${build.lib}/portal-core-identity-ui-lib.jar"/>
Modified: trunk/core-identity/src/bin/portal-identity-war/style.css
===================================================================
--- trunk/core-identity/src/bin/portal-identity-war/style.css 2007-09-18 11:30:28 UTC (rev 8313)
+++ trunk/core-identity/src/bin/portal-identity-war/style.css 2007-09-18 11:57:22 UTC (rev 8314)
@@ -49,7 +49,7 @@
.identity-ui ul.topnav {
margin-left: 0;
padding: 4px 0px 3px;
- border-bottom: 1px solid #dfe8ed;
+ border-bottom: 1px solid #b3c0c7;
}
.identity-ui ul.topnav li {
@@ -58,7 +58,7 @@
margin: 0;
padding: 3px 0.5em;
margin-left: 5px;
- border: 1px solid #dfe8ed;
+ border: 1px solid #b3c0c7;
border-bottom: none;
background-color: #f2f4f5;
}
@@ -75,6 +75,7 @@
.identity-ui ul.topnav li#currentTab a:hover {
}
+
/* Object path. */
.identity-ui ul.objectpath {
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java 2007-09-18 11:30:28 UTC (rev 8313)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java 2007-09-18 11:57:22 UTC (rev 8314)
@@ -56,6 +56,9 @@
/** . */
private List roles = new ArrayList();
+
+ /** . */
+ private List defaultRoles = null;
/** . */
private IdentityUIUser uiUser = new IdentityUIUser();
@@ -95,6 +98,7 @@
public void setDefaultRoles(List roles)
{
this.roles = roles;
+ this.defaultRoles = roles;
}
public IdentityUserBean getIdentityUserBean()
@@ -126,6 +130,13 @@
{
this.metaDataService = metaDataService;
}
+
+ public String cancelRegistration()
+ {
+ this.uiUser = new IdentityUIUser();
+ this.roles = defaultRoles;
+ return "start";
+ }
public void register(ActionEvent ev)
{
Modified: trunk/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties
===================================================================
--- trunk/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties 2007-09-18 11:30:28 UTC (rev 8313)
+++ trunk/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties 2007-09-18 11:57:22 UTC (rev 8314)
@@ -34,7 +34,8 @@
IDENTITY_REGISTER_TITLE_CONFIRM=Confirmation
IDENTITY_REGISTER_PASSWORD_CONFIRM=Confirm Password
IDENTITY_REGISTER_SUCCESS_TITLE=Your account has been successfully created. You may want to login now.
-IDENTITY_REGISTER_PENDING_TITLE=An e-mail has been sent to your e-mail address to verify your registration.
+IDENTITY_REGISTER_PENDING_TITLE=An e-mail has been sent to your e-mail address to verify your registration.
+IDENTITY_REGISTER_REQUIRED_INFORMATION=indicates a required field.
IDENTITY_LOST_PASSWORD_TITLE=Forgot your login data?
IDENTITY_LOST_PASSWORD_DESCRIPTION=Please enter your username to reset your password
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/registerRoles.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/registerRoles.xhtml 2007-09-18 11:30:28 UTC (rev 8313)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/user/registerRoles.xhtml 2007-09-18 11:57:22 UTC (rev 8314)
@@ -29,7 +29,7 @@
</h:selectManyCheckbox>
<hr/>
<p style="text-align: right;">
- <h:commandButton id="cancel" action="userAdmin" value="#{bundle.IDENTITY_BUTTON_CANCEL}" immediate="true" styleClass="portlet-form-button"/>
+ <h:commandButton id="cancel" action="#{userregistermgr.cancelRegistration}" value="#{bundle.IDENTITY_BUTTON_CANCEL}" immediate="true" styleClass="portlet-form-button"/>
<h:commandButton value="#{bundle.IDENTITY_BUTTON_SUBMIT}" action="register" styleClass="portlet-form-button"/>
</p>
</h:form>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/captcha.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/captcha.xhtml 2007-09-18 11:30:28 UTC (rev 8313)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/captcha.xhtml 2007-09-18 11:57:22 UTC (rev 8314)
@@ -10,7 +10,7 @@
<hr/>
<h:graphicImage url="/jcaptcha" />
<h:panelGrid columns="2">
- <h:outputText value="#{bundle.IDENTITY_REGISTER_VERIFY_CAPTCHA}" />
+ <h:outputText value="#{bundle.IDENTITY_REGISTER_VERIFY_CAPTCHA} *" />
<h:inputText id="validateCaptcha" value="" required="true">
<f:validator validatorId="CaptchaValidator" />
</h:inputText>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/confirm.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/confirm.xhtml 2007-09-18 11:30:28 UTC (rev 8313)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/confirm.xhtml 2007-09-18 11:57:22 UTC (rev 8314)
@@ -30,7 +30,7 @@
<h:messages />
<hr/>
<p style="text-align: right;">
- <h:commandButton id="cancel" action="start" value="#{bundle.IDENTITY_BUTTON_CANCEL}" immediate="true" styleClass="portlet-form-button"/>
+ <h:commandButton id="cancel" action="#{manager.cancelRegistration}" value="#{bundle.IDENTITY_BUTTON_CANCEL}" immediate="true" styleClass="portlet-form-button"/>
<h:commandButton value="#{bundle.IDENTITY_BUTTON_EDIT}" action="revise" styleClass="portlet-form-button"/>
<h:commandButton id="#{subscriptionMode}" value="#{bundle.IDENTITY_BUTTON_SUBMIT}" actionListener="#{manager.register}" action="registered" styleClass="portlet-form-button"/>
</p>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/register.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/register.xhtml 2007-09-18 11:30:28 UTC (rev 8313)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/register.xhtml 2007-09-18 11:57:22 UTC (rev 8314)
@@ -8,27 +8,30 @@
<h:form>
<h:panelGrid columns="2" cellpadding="3">
- <h:outputText value="#{bundle.IDENTITY_USERNAME}"/>
+ <h:outputText value="#{bundle.IDENTITY_USERNAME} *"/>
<h:inputText id="username" value="#{manager.uiUser.username}" required="true">
<f:validator validatorId="UsernameValidator"/>
</h:inputText>
<h:panelGroup />
<h:message for="username" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+ <h:panelGroup>
<h:outputText value="#{bundle.IDENTITY_EMAIL}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.email.required}" />
+ </h:panelGroup>
<h:inputText id="#{metadataservice.email.name}" value="#{manager.uiUser.attribute.email}" required="#{metadataservice.email.required}">
<f:validator validatorId="#{metadataservice.email.validator}"/>
</h:inputText>
<h:panelGroup />
<h:message for="#{metadataservice.email.name}" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
- <h:outputText value="#{bundle.IDENTITY_PASSWORD}"/>
+ <h:outputText value="#{bundle.IDENTITY_PASSWORD} *"/>
<h:inputSecret id="password" value="#{manager.uiUser.password}" required="true">
<f:validateLength minimum="6"/>
</h:inputSecret>
<h:panelGroup />
<h:message for="password" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
- <h:outputText value="#{bundle.IDENTITY_REGISTER_PASSWORD_CONFIRM}"/>
+ <h:outputText value="#{bundle.IDENTITY_REGISTER_PASSWORD_CONFIRM} *"/>
<h:inputSecret id="passwordCheck" required="true">
<f:validator validatorId="PasswordValidator"/>
</h:inputSecret>
@@ -42,9 +45,16 @@
<ui:include src="/WEB-INF/jsf/common/captcha.xhtml" />
<hr/>
- <p style="text-align: right;">
- <h:commandButton id="cancel" action="start" value="#{bundle.IDENTITY_BUTTON_CANCEL}" immediate="true" styleClass="portlet-form-button"/>
- <h:commandButton id="submit" action="register" value="#{bundle.IDENTITY_BUTTON_SUBMIT}" styleClass="portlet-form-button"/>
-</p>
+ <table style="width: 100%">
+ <tr>
+ <td style="text-align: left;">
+ <h:outputText value="* #{bundle.IDENTITY_REGISTER_REQUIRED_INFORMATION}" />
+ </td>
+ <td style="text-align: right;">
+ <h:commandButton id="cancel" action="#{manager.cancelRegistration}" value="#{bundle.IDENTITY_BUTTON_CANCEL}" immediate="true" styleClass="portlet-form-button"/>
+ <h:commandButton id="submit" action="register" value="#{bundle.IDENTITY_BUTTON_SUBMIT}" styleClass="portlet-form-button"/>
+ </td>
+ </tr>
+ </table>
</h:form>
</div>
\ No newline at end of file
18 years, 7 months
JBoss Portal SVN: r8313 - branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-server-war/WEB-INF.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-09-18 07:30:28 -0400 (Tue, 18 Sep 2007)
New Revision: 8313
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-server-war/WEB-INF/context.xml
Log:
commented out OpenSSO integration tomcat valve
Modified: branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-server-war/WEB-INF/context.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-server-war/WEB-INF/context.xml 2007-09-18 11:28:41 UTC (rev 8312)
+++ branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-server-war/WEB-INF/context.xml 2007-09-18 11:30:28 UTC (rev 8313)
@@ -23,5 +23,19 @@
<!--
<Valve className="org.jboss.portal.identity.sso.josso.JOSSOLogoutValve"/>
-->
+
+ <!--
+ | Uncomment to enable OpenSSO server based SSO authentication.
+ -->
+
+ <!--
+ <Valve className="org.jboss.portal.identity.sso.opensso.OpenSSOAuthenticationValve"
+ loginURL="http://www.domain.com/opensso"
+ logoutURL="http://www.domain.com/opensso/UI/Logout"
+ appendLoginGoto="true"
+ appendLogoutGoto="true"
+ authType="FORM"
+ />
+ -->
</Context>
\ No newline at end of file
18 years, 7 months
JBoss Portal SVN: r8312 - in modules/identity/trunk: sso and 2 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-09-18 07:28:41 -0400 (Tue, 18 Sep 2007)
New Revision: 8312
Added:
modules/identity/trunk/sso/src/main/org/jboss/portal/identity/sso/opensso/
modules/identity/trunk/sso/src/main/org/jboss/portal/identity/sso/opensso/OpenSSOAuthenticationValve.java
Modified:
modules/identity/trunk/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java
modules/identity/trunk/sso/build.xml
Log:
OpenSSO integration
Modified: modules/identity/trunk/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java 2007-09-18 10:48:01 UTC (rev 8311)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java 2007-09-18 11:28:41 UTC (rev 8312)
@@ -301,19 +301,19 @@
{
public Object run() throws Exception
{
+ Group rolesGroup = new SimpleGroup("Roles");
+
+ //
+ if (additionalRole != null) {
+ rolesGroup.addMember(createIdentity(additionalRole));
+ }
+
try {
User user = getUserModule().findUserByUserName(getUsername());
Set roles = getMembershipModule().getRoles(user);
//
- Group rolesGroup = new SimpleGroup("Roles");
- //
- if (additionalRole != null) {
- rolesGroup.addMember(createIdentity(additionalRole));
- }
-
- //
for (Iterator iterator = roles.iterator(); iterator.hasNext();) {
Role role = (Role) iterator.next();
String roleName = role.getName();
@@ -325,11 +325,12 @@
}
}
- //
- return new Group[] { rolesGroup };
+
} catch (Exception e) {
throw new LoginException(e.toString());
}
+ //
+ return new Group[] { rolesGroup };
}
});
} catch (Exception e) {
Modified: modules/identity/trunk/sso/build.xml
===================================================================
--- modules/identity/trunk/sso/build.xml 2007-09-18 10:48:01 UTC (rev 8311)
+++ modules/identity/trunk/sso/build.xml 2007-09-18 11:28:41 UTC (rev 8312)
@@ -103,6 +103,7 @@
<path refid="junit.junit.classpath"/>
<path refid="apache.tomcat.classpath"/>
<path refid="josso.josso.classpath"/>
+ <path refid="opensso.opensso.classpath"/>
<path refid="cas.cas.classpath"/>
<path refid="spring.spring.classpath"/>
Added: modules/identity/trunk/sso/src/main/org/jboss/portal/identity/sso/opensso/OpenSSOAuthenticationValve.java
===================================================================
--- modules/identity/trunk/sso/src/main/org/jboss/portal/identity/sso/opensso/OpenSSOAuthenticationValve.java (rev 0)
+++ modules/identity/trunk/sso/src/main/org/jboss/portal/identity/sso/opensso/OpenSSOAuthenticationValve.java 2007-09-18 11:28:41 UTC (rev 8312)
@@ -0,0 +1,381 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.portal.identity.sso.opensso;
+
+import org.apache.catalina.valves.ValveBase;
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
+import org.apache.catalina.Context;
+import org.apache.catalina.Session;
+import org.apache.catalina.authenticator.Constants;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.security.jacc.PolicyContext;
+import java.io.IOException;
+import java.security.Principal;
+
+import com.iplanet.sso.SSOTokenManager;
+import com.iplanet.sso.SSOToken;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 0.1 $
+ */
+public class OpenSSOAuthenticationValve extends ValveBase
+{
+ /** . */
+ private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(OpenSSOAuthenticationValve.class);
+
+ public static final String WEB_REQUEST_KEY = "javax.servlet.http.HttpServletRequest";
+
+ private String loginURL;
+
+ private String logoutURL;
+
+ private boolean appendLoginGoto = true;
+
+ private boolean appendLogoutGoto = true;
+
+ private String loginParameters;
+
+ private String logoutParameters;
+
+ private String authType = "FORM";
+
+ public void invoke(Request request, Response response) throws IOException, ServletException
+ {
+
+ SSOToken token = getToken();
+
+ String requestURI = request.getRequestURI();
+
+ // When token is not present and secured portal url is requested
+
+ if ((requestURI.indexOf("/auth/") != -1
+ || requestURI.indexOf("/authsec/") != -1 || requestURI
+ .indexOf("/sec/") != -1)
+ && token == null)
+ {
+ // Perform OpenSSO login by going to the OpenSSO authentication server
+
+ redirectToOpenSSOLogin(request, response);
+ return;
+ }
+
+ // When token present and valid
+
+ if (token != null && isTokenValid(token))
+ {
+
+ try
+ {
+ // Perform the portal JAAS authentication
+
+ String user = token.getProperty("UserId");
+ request.setAttribute("ssoSuccess", new Boolean(true));
+ Principal principal = ((Context) this.container).getRealm().authenticate(user, (String) null);
+ if (principal != null)
+ {
+ this.register(request, response, principal, getAuthType(), user,
+ (String) null);
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("Failed to perform JAAS login: ", e);
+ }
+ }
+
+ // Continue processing the request
+
+ this.getNext().invoke(request, response);
+
+
+ // Signout request
+
+ if ((token != null && (!isTokenValid(token) || request.getRequestURI().endsWith("/signout"))))
+ {
+ destroyToken(token);
+ redirectToOpenSSOLogout(request,response);
+ }
+ else if (token == null && request.getUserPrincipal() != null)
+ {
+ // Illegal state - no SSO token present but still authenticated
+ request.getSession().invalidate();
+ }
+
+ }
+
+ private void redirectToOpenSSOLogin(HttpServletRequest request, HttpServletResponse response) throws IOException
+ {
+
+ StringBuffer redirect = new StringBuffer();
+ redirect.append(getLoginURL());
+ if (isAppendLoginGoto())
+ {
+ redirect.append("?goto=")
+ .append(request.getRequestURL());
+ }
+
+ if (getLoginParameters() != null && getLoginParameters().length() > 0)
+ {
+ if (isAppendLoginGoto())
+ {
+ redirect.append("&");
+ }
+ else
+ {
+ redirect.append("?");
+ }
+ redirect.append(getLoginParameters());
+ }
+
+ if (log.isDebugEnabled()) log.debug("Redirect to OpenSSO login URL: " + redirect.toString());
+
+ response.sendRedirect(redirect.toString());
+ }
+
+ private void redirectToOpenSSOLogout(HttpServletRequest request, HttpServletResponse response) throws IOException
+ {
+
+ StringBuffer redirect = new StringBuffer();
+ redirect.append(getLogoutURL());
+ if (isAppendLogoutGoto())
+ {
+ StringBuffer url = new StringBuffer();
+ if (request.isSecure())
+ {
+ url.append("https://");
+ }
+ else
+ {
+ url.append("http://");
+ }
+ url.append(request.getServerName())
+ .append(":")
+ .append(request.getServerPort())
+ .append(request.getContextPath());
+
+ redirect.append("?goto=")
+ .append(url);
+ }
+
+ if (getLogoutParameters() != null && getLogoutParameters().length() > 0)
+ {
+ if (isAppendLogoutGoto())
+ {
+ redirect.append("&");
+ }
+ else
+ {
+ redirect.append("?");
+ }
+ redirect.append(getLogoutParameters());
+ }
+
+ if (log.isDebugEnabled()) log.debug("Redirect to OpenSSO logout URL: " + redirect.toString());
+
+ response.sendRedirect(redirect.toString());
+ }
+
+ private SSOToken getToken()
+ {
+ try {
+ HttpServletRequest request = (HttpServletRequest) PolicyContext.getContext(WEB_REQUEST_KEY);
+
+ SSOTokenManager manager = SSOTokenManager.getInstance();
+
+ SSOToken token = manager.createSSOToken(request);
+
+ return token;
+
+ } catch (Exception e) {
+ log.debug("Failed to obtain SSO Token: " + e);
+ }
+
+ return null;
+ }
+
+ private boolean isTokenValid(SSOToken token)
+ {
+ if (token == null)
+ {
+ throw new IllegalArgumentException("Token cannot be null");
+ }
+
+ try {
+ SSOTokenManager manager = SSOTokenManager.getInstance();
+
+ return manager.isValidToken(token);
+
+ }
+ catch (Exception e)
+ {
+ log.debug("Failed to validate SSO Token: " + e);
+ }
+ return false;
+ }
+
+ private void destroyToken(SSOToken token)
+ {
+ if (token == null)
+ {
+ throw new IllegalArgumentException("Token cannot be null");
+ }
+
+ try {
+ SSOTokenManager manager = SSOTokenManager.getInstance();
+
+ manager.destroyToken(token);
+
+ }
+ catch (Exception e)
+ {
+ log.debug("Failed to destroy SSO Token: " + e);
+ }
+ }
+
+ /**
+ * Register an authenticated Principal and authentication type in our
+ * request, in the current session (if there is one), and with our
+ * SingleSignOn valve, if there is one. Set the appropriate cookie to be
+ * returned.
+ *
+ * @param request
+ * The servlet request we are processing
+ * @param response
+ * The servlet response we are generating
+ * @param principal
+ * The authenticated Principal to be registered
+ * @param authType
+ * The authentication type to be registered
+ * @param username
+ * Username used to authenticate (if any)
+ * @param password
+ * Password used to authenticate (if any)
+ */
+ private void register(Request request, Response response,
+ Principal principal, String authType, String username, String password)
+ {
+ // Cache the authentication information in our request
+ request.setAuthType(authType);
+ request.setUserPrincipal(principal);
+
+ Session session = request.getSessionInternal(false);
+ // Cache the authentication information in our session, if any
+ if (session != null)
+ {
+ session.setAuthType(authType);
+ session.setPrincipal(principal);
+ if (username != null)
+ {
+ session.setNote(Constants.SESS_USERNAME_NOTE, username);
+ }
+ else
+ {
+ session.removeNote(Constants.SESS_USERNAME_NOTE);
+ }
+ if (password != null)
+ {
+ session.setNote(Constants.SESS_PASSWORD_NOTE, password);
+ }
+ else
+ {
+ session.removeNote(Constants.SESS_PASSWORD_NOTE);
+ }
+ }
+ }
+
+
+ public String getLoginURL()
+ {
+ return loginURL;
+ }
+
+ public void setLoginURL(String loginURL)
+ {
+ this.loginURL = loginURL;
+ }
+
+ public String getLogoutURL()
+ {
+ return logoutURL;
+ }
+
+ public void setLogoutURL(String logoutURL)
+ {
+ this.logoutURL = logoutURL;
+ }
+
+ public boolean isAppendLoginGoto()
+ {
+ return appendLoginGoto;
+ }
+
+ public void setAppendLoginGoto(boolean appendLoginGoto)
+ {
+ this.appendLoginGoto = appendLoginGoto;
+ }
+
+ public boolean isAppendLogoutGoto()
+ {
+ return appendLogoutGoto;
+ }
+
+ public void setAppendLogoutGoto(boolean appendLogoutGoto)
+ {
+ this.appendLogoutGoto = appendLogoutGoto;
+ }
+
+ public String getLoginParameters()
+ {
+ return loginParameters;
+ }
+
+ public void setLoginParameters(String loginParameters)
+ {
+ this.loginParameters = loginParameters;
+ }
+
+ public String getLogoutParameters()
+ {
+ return logoutParameters;
+ }
+
+ public void setLogoutParameters(String logoutParameters)
+ {
+ this.logoutParameters = logoutParameters;
+ }
+
+ public String getAuthType()
+ {
+ return authType;
+ }
+
+ public void setAuthType(String authType)
+ {
+ this.authType = authType;
+ }
+}
18 years, 7 months
JBoss Portal SVN: r8311 - in trunk/core-identity/src: main/org/jboss/portal/core/identity/services/metadata and 1 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-09-18 06:48:01 -0400 (Tue, 18 Sep 2007)
New Revision: 8311
Added:
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/WorkflowSoftDependency.java
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationService.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java
trunk/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml
Log:
Add a soft dependency on the Workflow service.
Copied: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/WorkflowSoftDependency.java (from rev 8310, branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/services/WorkflowSoftDependency.java)
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/WorkflowSoftDependency.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/WorkflowSoftDependency.java 2007-09-18 10:48:01 UTC (rev 8311)
@@ -0,0 +1,173 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.identity.services;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.MBeanServerNotification;
+import javax.management.Notification;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+import org.jboss.portal.core.identity.services.metadata.IdentityUIConfigurationService;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.workflow.service.WorkflowService;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class WorkflowSoftDependency extends AbstractJBossService
+{
+
+ private Logger log = Logger.getLogger(WorkflowSoftDependency.class);
+
+ private MBeanServer server;
+
+ private IdentityUIConfigurationService identityUIConfigurationService;
+
+ private NotificationListener notificationListener;
+
+ private ObjectName mbeanServerDelegate;
+
+ private ObjectName workflowServiceObjectName;
+
+ public WorkflowSoftDependency()
+ {
+ server = (MBeanServer)MBeanServerFactory.findMBeanServer(null).get(0);
+ try
+ {
+ mbeanServerDelegate = new ObjectName("JMImplementation:type=MBeanServerDelegate");
+ workflowServiceObjectName = new ObjectName("portal:service=Workflow,type=WorkflowService");
+ notificationListener = new WorkflowServiceNotificationListener(workflowServiceObjectName);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void startService()
+ {
+ // Check if the workflow service is already registered
+ if (server.isRegistered(workflowServiceObjectName))
+ {
+ try
+ {
+ WorkflowService workflowService = (WorkflowService)MBeanProxy.get(WorkflowService.class, workflowServiceObjectName, server);
+ identityUIConfigurationService.setWorkflowService(workflowService);
+ log.debug("Starting identityUIConfigurationService workflow part");
+ identityUIConfigurationService.startWorkflow();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ // Add the listener for registration/unregistration if the workflow service
+ try
+ {
+ server.addNotificationListener(mbeanServerDelegate, notificationListener, null, identityUIConfigurationService);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void stopService()
+ {
+ try
+ {
+ server.removeNotificationListener(mbeanServerDelegate, notificationListener);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void setIdentityUIConfigurationService(IdentityUIConfigurationService identityUIConfigurationService)
+ {
+ this.identityUIConfigurationService = identityUIConfigurationService;
+ }
+
+ private class WorkflowServiceNotificationListener implements NotificationListener
+ {
+
+ ObjectName objectName = null;
+
+ public WorkflowServiceNotificationListener(ObjectName objectName)
+ {
+ this.objectName = objectName;
+ }
+
+ public void handleNotification(Notification notification, Object object)
+ {
+ if (notification instanceof MBeanServerNotification)
+ {
+ MBeanServerNotification notif = (MBeanServerNotification)notification;
+ try
+ {
+ if (notif.getMBeanName().equals(objectName))
+ {
+ IdentityUIConfigurationService identityUIConfigurationService = (IdentityUIConfigurationService)object;
+ if (notif.getType().equals(MBeanServerNotification.REGISTRATION_NOTIFICATION))
+ {
+ try
+ {
+ WorkflowService workflowService = (WorkflowService)MBeanProxy.get(WorkflowService.class, new ObjectName("portal:service=Workflow,type=WorkflowService"), server);
+ identityUIConfigurationService.setWorkflowService(workflowService);
+ log.debug("Starting identityUIConfigurationService workflow part");
+ identityUIConfigurationService.startWorkflow();
+
+ }
+ catch (MBeanProxyCreationException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ else
+ {
+ // Unregistration
+ log.debug("Stopping identityUIConfigurationService workflow part");
+ identityUIConfigurationService.stopWorkflow();
+ identityUIConfigurationService.setWorkflowService(null);
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ }
+
+}
+
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationService.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationService.java 2007-09-18 10:25:44 UTC (rev 8310)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationService.java 2007-09-18 10:48:01 UTC (rev 8311)
@@ -49,5 +49,11 @@
* @throws NamingException
*/
WorkflowService getWorkflowService();
+
+ void setWorkflowService(WorkflowService workflowService);
+
+ void startWorkflow() throws Exception;
+
+ void stopWorkflow() throws Exception;
}
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java 2007-09-18 10:25:44 UTC (rev 8310)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java 2007-09-18 10:48:01 UTC (rev 8311)
@@ -27,8 +27,6 @@
import java.net.URL;
import java.util.Map;
-import javax.naming.InitialContext;
-
import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.core.identity.services.IdentityConstants;
import org.jboss.portal.identity.IdentityContext;
@@ -82,15 +80,10 @@
/** The jndi name */
private String jndiName = null;
- public void startService() throws Exception
+ public void startWorkflow() throws Exception
{
- super.startService();
-
try
{
- // Creating IdentityUIConfiguration
- this.configuration = this.createConfiguration();
-
// Loading workflow if subscriptionmodes != automatic
if (this.configuration.enableWorkflow())
{
@@ -127,6 +120,19 @@
super.stopService();
throw new CoreIdentityConfigurationException(e);
}
+ }
+
+ public void stopWorkflow()
+ {
+
+ }
+
+
+ public void startService() throws Exception
+ {
+ super.startService();
+ // Creating IdentityUIConfiguration
+ this.configuration = this.createConfiguration();
if (this.jndiName != null)
{
@@ -161,11 +167,6 @@
return this.configuration;
}
- public void setWorkflowService(WorkflowService workflowService)
- {
- this.workflowService = workflowService;
- }
-
public IdentityServiceController getIdentityServiceController()
{
return identityServiceController;
@@ -200,20 +201,14 @@
public WorkflowService getWorkflowService()
{
- if ( workflowService == null)
- {
- try
- {
- this.workflowService = (WorkflowService) new InitialContext().lookup("java:/portal/WorkflowService");
- }
- catch (Exception e)
- {
- log.error("", e);
- }
- }
return workflowService;
}
+ public void setWorkflowService(WorkflowService workflowService)
+ {
+ this.workflowService = workflowService;
+ }
+
private void createJBPMContext(String processName) throws CoreIdentityConfigurationException
{
if (!IdentityConstants.SUBSCRIPTION_MODE_AUTOMATIC.equals(processName))
Modified: trunk/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml 2007-09-18 10:25:44 UTC (rev 8310)
+++ trunk/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml 2007-09-18 10:48:01 UTC (rev 8311)
@@ -130,4 +130,14 @@
proxy-type="attribute">portal:commandFactory=IdentityUI</depends>
</mbean>
+ <mbean
+ code="org.jboss.portal.core.identity.services.WorkflowSoftDependency"
+ name="portal:service=WorkflowSoftDependency"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <depends
+ optional-attribute-name="IdentityUIConfigurationService"
+ proxy-type="attribute">portal:service=IdentityUIConfigurationService,type=IdentityUI</depends>
+ <xmbean/>
+ </mbean>
</server>
\ No newline at end of file
18 years, 7 months
JBoss Portal SVN: r8310 - in branches/JBoss_Portal_Branch_2_6/core-identity/src: main/org/jboss/portal/core/identity/services/metadata and 1 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-09-18 06:25:44 -0400 (Tue, 18 Sep 2007)
New Revision: 8310
Added:
branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/services/WorkflowSoftDependency.java
Modified:
branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationService.java
branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java
branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml
Log:
Add a soft dependency on the Workflow service.
Added: branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/services/WorkflowSoftDependency.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/services/WorkflowSoftDependency.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/services/WorkflowSoftDependency.java 2007-09-18 10:25:44 UTC (rev 8310)
@@ -0,0 +1,173 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.identity.services;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.MBeanServerNotification;
+import javax.management.Notification;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+import org.jboss.portal.core.identity.services.metadata.IdentityUIConfigurationService;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.workflow.service.WorkflowService;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class WorkflowSoftDependency extends AbstractJBossService
+{
+
+ private Logger log = Logger.getLogger(WorkflowSoftDependency.class);
+
+ private MBeanServer server;
+
+ private IdentityUIConfigurationService identityUIConfigurationService;
+
+ private NotificationListener notificationListener;
+
+ private ObjectName mbeanServerDelegate;
+
+ private ObjectName workflowServiceObjectName;
+
+ public WorkflowSoftDependency()
+ {
+ server = (MBeanServer)MBeanServerFactory.findMBeanServer(null).get(0);
+ try
+ {
+ mbeanServerDelegate = new ObjectName("JMImplementation:type=MBeanServerDelegate");
+ workflowServiceObjectName = new ObjectName("portal:service=Workflow,type=WorkflowService");
+ notificationListener = new WorkflowServiceNotificationListener(workflowServiceObjectName);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void startService()
+ {
+ // Check if the workflow service is already registered
+ if (server.isRegistered(workflowServiceObjectName))
+ {
+ try
+ {
+ WorkflowService workflowService = (WorkflowService)MBeanProxy.get(WorkflowService.class, workflowServiceObjectName, server);
+ identityUIConfigurationService.setWorkflowService(workflowService);
+ log.debug("Starting identityUIConfigurationService workflow part");
+ identityUIConfigurationService.startWorkflow();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ // Add the listener for registration/unregistration if the workflow service
+ try
+ {
+ server.addNotificationListener(mbeanServerDelegate, notificationListener, null, identityUIConfigurationService);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void stopService()
+ {
+ try
+ {
+ server.removeNotificationListener(mbeanServerDelegate, notificationListener);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void setIdentityUIConfigurationService(IdentityUIConfigurationService identityUIConfigurationService)
+ {
+ this.identityUIConfigurationService = identityUIConfigurationService;
+ }
+
+ private class WorkflowServiceNotificationListener implements NotificationListener
+ {
+
+ ObjectName objectName = null;
+
+ public WorkflowServiceNotificationListener(ObjectName objectName)
+ {
+ this.objectName = objectName;
+ }
+
+ public void handleNotification(Notification notification, Object object)
+ {
+ if (notification instanceof MBeanServerNotification)
+ {
+ MBeanServerNotification notif = (MBeanServerNotification)notification;
+ try
+ {
+ if (notif.getMBeanName().equals(objectName))
+ {
+ IdentityUIConfigurationService identityUIConfigurationService = (IdentityUIConfigurationService)object;
+ if (notif.getType().equals(MBeanServerNotification.REGISTRATION_NOTIFICATION))
+ {
+ try
+ {
+ WorkflowService workflowService = (WorkflowService)MBeanProxy.get(WorkflowService.class, new ObjectName("portal:service=Workflow,type=WorkflowService"), server);
+ identityUIConfigurationService.setWorkflowService(workflowService);
+ log.debug("Starting identityUIConfigurationService workflow part");
+ identityUIConfigurationService.startWorkflow();
+
+ }
+ catch (MBeanProxyCreationException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ else
+ {
+ // Unregistration
+ log.debug("Stopping identityUIConfigurationService workflow part");
+ identityUIConfigurationService.stopWorkflow();
+ identityUIConfigurationService.setWorkflowService(null);
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ }
+
+}
+
Modified: branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationService.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationService.java 2007-09-18 01:55:41 UTC (rev 8309)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationService.java 2007-09-18 10:25:44 UTC (rev 8310)
@@ -49,5 +49,11 @@
* @throws NamingException
*/
WorkflowService getWorkflowService();
+
+ void setWorkflowService(WorkflowService workflowService);
+
+ void startWorkflow() throws Exception;
+
+ void stopWorkflow() throws Exception;
}
Modified: branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java 2007-09-18 01:55:41 UTC (rev 8309)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java 2007-09-18 10:25:44 UTC (rev 8310)
@@ -27,8 +27,6 @@
import java.net.URL;
import java.util.Map;
-import javax.naming.InitialContext;
-
import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.core.identity.services.IdentityConstants;
import org.jboss.portal.identity.IdentityContext;
@@ -82,15 +80,10 @@
/** The jndi name */
private String jndiName = null;
- public void startService() throws Exception
+ public void startWorkflow() throws Exception
{
- super.startService();
-
try
{
- // Creating IdentityUIConfiguration
- this.configuration = this.createConfiguration();
-
// Loading workflow if subscriptionmodes != automatic
if (this.configuration.enableWorkflow())
{
@@ -127,6 +120,19 @@
super.stopService();
throw new CoreIdentityConfigurationException(e);
}
+ }
+
+ public void stopWorkflow()
+ {
+
+ }
+
+
+ public void startService() throws Exception
+ {
+ super.startService();
+ // Creating IdentityUIConfiguration
+ this.configuration = this.createConfiguration();
if (this.jndiName != null)
{
@@ -161,11 +167,6 @@
return this.configuration;
}
- public void setWorkflowService(WorkflowService workflowService)
- {
- this.workflowService = workflowService;
- }
-
public IdentityServiceController getIdentityServiceController()
{
return identityServiceController;
@@ -200,20 +201,14 @@
public WorkflowService getWorkflowService()
{
- if ( workflowService == null)
- {
- try
- {
- this.workflowService = (WorkflowService) new InitialContext().lookup("java:/portal/WorkflowService");
- }
- catch (Exception e)
- {
- log.error("", e);
- }
- }
return workflowService;
}
+ public void setWorkflowService(WorkflowService workflowService)
+ {
+ this.workflowService = workflowService;
+ }
+
private void createJBPMContext(String processName) throws CoreIdentityConfigurationException
{
if (!IdentityConstants.SUBSCRIPTION_MODE_AUTOMATIC.equals(processName))
Modified: branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml 2007-09-18 01:55:41 UTC (rev 8309)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml 2007-09-18 10:25:44 UTC (rev 8310)
@@ -58,7 +58,6 @@
<depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">
portal:service=Module,type=IdentityServiceController
</depends>
- <depends>portal:service=Workflow,type=WorkflowService</depends>
<attribute name="JNDIName">java:portal/IdentityUIConfigurationService</attribute>
</mbean>
@@ -130,4 +129,14 @@
proxy-type="attribute">portal:commandFactory=IdentityUI</depends>
</mbean>
+ <mbean
+ code="org.jboss.portal.core.identity.services.WorkflowSoftDependency"
+ name="portal:service=WorkflowSoftDependency"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <depends
+ optional-attribute-name="IdentityUIConfigurationService"
+ proxy-type="attribute">portal:service=IdentityUIConfigurationService,type=IdentityUI</depends>
+ <xmbean/>
+ </mbean>
</server>
\ No newline at end of file
18 years, 7 months
JBoss Portal SVN: r8309 - in trunk/core-admin/src: resources/portal-admin-war/WEB-INF/jsf and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-09-17 21:55:41 -0400 (Mon, 17 Sep 2007)
New Revision: 8309
Added:
trunk/core-admin/src/resources/portal-admin-war/img/msgIcon_Warning.gif
Modified:
trunk/core-admin/src/bin/portal-admin-war/style.css
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/confirmDeleteInstance.xhtml
Log:
- JBPORTAL-1657: Added icon, started styling.
Modified: trunk/core-admin/src/bin/portal-admin-war/style.css
===================================================================
--- trunk/core-admin/src/bin/portal-admin-war/style.css 2007-09-18 01:49:31 UTC (rev 8308)
+++ trunk/core-admin/src/bin/portal-admin-war/style.css 2007-09-18 01:55:41 UTC (rev 8309)
@@ -460,4 +460,14 @@
.admin-ui .objectList .objectActionColumn {
width: 75%;
-}
\ No newline at end of file
+}
+
+.admin-ui .portlet-msg {
+ border: 1px solid #d5d5d5;
+ margin: auto;
+}
+
+.admin-ui .portlet-msg-icon {
+ float: left;
+}
+
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml 2007-09-18 01:49:31 UTC (rev 8308)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml 2007-09-18 01:55:41 UTC (rev 8309)
@@ -13,11 +13,12 @@
<ui:define name="content">
<div class="portlet-msg">
- <div class="portlet-msg-icon"><h:graphicImage url="/img/msgIcon_Warning.gif" alt="/!\"/></div>
<div class="portlet-msg-body">
<h3>Delete <h:outputText value="#{portalobjectmgr.selectedObjectType}"/></h3>
- <p class="portlet-msg-alert">WARNING! You are about to delete the
+ <p class="portlet-msg-alert">
+ <h:graphicImage url="/img/msgIcon_Warning.gif" alt="/!\" styleClass="portlet-msg-icon"/>
+ WARNING! You are about to delete the
<span class="objectName">#{portalobjectmgr.selectedObject.name}</span>
#{portalobjectmgr.selectedObject.typeName} from the
<c:if test="#{not empty portalobjectmgr.selectedObjectParent.name}">
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/confirmDeleteInstance.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/confirmDeleteInstance.xhtml 2007-09-18 01:49:31 UTC (rev 8308)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/confirmDeleteInstance.xhtml 2007-09-18 01:55:41 UTC (rev 8309)
@@ -24,11 +24,12 @@
<br/>
<div class="portlet-msg">
- <div class="portlet-msg-icon"><h:graphicImage url="/img/msgIcon_Warning.gif" alt="/!\"/></div>
<div class="portlet-msg-body">
<h3>Delete <span class="objectName">#{instancemgr.selectedInstance.id}</span></h3>
- <p class="portlet-msg-alert">WARNING! You are about to delete the
+ <p class="portlet-msg-alert">
+ <h:graphicImage url="/img/msgIcon_Warning.gif" alt="/!\" styleClass="portlet-msg-icon"/>
+ WARNING! You are about to delete the
<span class="objectName">#{instancemgr.selectedInstance.id}</span> portlet instance causing windows
referencing it to not be able to display their content anymore.
</p>
Copied: trunk/core-admin/src/resources/portal-admin-war/img/msgIcon_Warning.gif (from rev 8308, branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/img/msgIcon_Warning.gif)
===================================================================
(Binary files differ)
18 years, 7 months
JBoss Portal SVN: r8308 - in branches/JBoss_Portal_Branch_2_6/core-admin/src: resources/portal-admin-war/WEB-INF/jsf and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-09-17 21:49:31 -0400 (Mon, 17 Sep 2007)
New Revision: 8308
Added:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/img/msgIcon_Warning.gif
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/style.css
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/confirmDeleteInstance.xhtml
Log:
- JBPORTAL-1657: Added icon, started styling.
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/style.css
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/style.css 2007-09-18 01:20:26 UTC (rev 8307)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/style.css 2007-09-18 01:49:31 UTC (rev 8308)
@@ -462,3 +462,12 @@
width: 75%;
}
+.admin-ui .portlet-msg {
+ border: 1px solid #d5d5d5;
+ margin: auto;
+}
+
+.admin-ui .portlet-msg-icon {
+ float: left;
+}
+
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml 2007-09-18 01:20:26 UTC (rev 8307)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml 2007-09-18 01:49:31 UTC (rev 8308)
@@ -13,11 +13,12 @@
<ui:define name="content">
<div class="portlet-msg">
- <div class="portlet-msg-icon"><h:graphicImage url="/img/msgIcon_Warning.gif" alt="/!\"/></div>
<div class="portlet-msg-body">
<h3>Delete <h:outputText value="#{portalobjectmgr.selectedObjectType}"/></h3>
- <p class="portlet-msg-alert">WARNING! You are about to delete the
+ <p class="portlet-msg-alert">
+ <h:graphicImage url="/img/msgIcon_Warning.gif" alt="/!\" styleClass="portlet-msg-icon"/>
+ WARNING! You are about to delete the
<span class="objectName">#{portalobjectmgr.selectedObject.name}</span>
#{portalobjectmgr.selectedObject.typeName} from the
<c:if test="#{not empty portalobjectmgr.selectedObjectParent.name}">
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/confirmDeleteInstance.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/confirmDeleteInstance.xhtml 2007-09-18 01:20:26 UTC (rev 8307)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/confirmDeleteInstance.xhtml 2007-09-18 01:49:31 UTC (rev 8308)
@@ -24,11 +24,12 @@
<br/>
<div class="portlet-msg">
- <div class="portlet-msg-icon"><h:graphicImage url="/img/msgIcon_Warning.gif" alt="/!\"/></div>
<div class="portlet-msg-body">
<h3>Delete <span class="objectName">#{instancemgr.selectedInstance.id}</span></h3>
- <p class="portlet-msg-alert">WARNING! You are about to delete the
+ <p class="portlet-msg-alert">
+ <h:graphicImage url="/img/msgIcon_Warning.gif" alt="/!\" styleClass="portlet-msg-icon"/>
+ WARNING! You are about to delete the
<span class="objectName">#{instancemgr.selectedInstance.id}</span> portlet instance causing windows
referencing it to not be able to display their content anymore.
</p>
Added: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/img/msgIcon_Warning.gif
===================================================================
(Binary files differ)
Property changes on: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/img/msgIcon_Warning.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
18 years, 7 months
JBoss Portal SVN: r8307 - in trunk/wsrp/src: main/org/jboss/portal/test/wsrp/framework/support and 6 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-09-17 21:20:26 -0400 (Mon, 17 Sep 2007)
New Revision: 8307
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/BehaviorBackedServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractJNDIServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/PerEndpointSOAPInvokerServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java
trunk/wsrp/src/resources/portal-wsrp-sar/conf/producer/config.xml
Log:
- JBPORTAL-1700
+ ConsumerRegistryService should be able to start even if a consumer throws an Exception.
+ Added ServiceFactory.isFailed method to avoid infinite loop if a consumer is not available and fails to start.
+ Now uses a default validator for registration properties if none was provided (to allow for empty registration configurations.
+ RegistrationPolicy is not initialized anymore if registration is not required.
+ Do not initialize RegistrationManager if registration is not required.
+ Updated ProducerConfigurationTestCase.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java 2007-09-18 01:07:30 UTC (rev 8306)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java 2007-09-18 01:20:26 UTC (rev 8307)
@@ -102,13 +102,18 @@
Map properties = requirements.getRegistrationProperties();
assertNotNull(properties);
assertTrue(properties.isEmpty());
+ assertNotNull(requirements.getPolicy());
}
public void testMinimalUnmarshalling() throws Exception
{
ProducerConfiguration producerConfiguration = getProducerConfiguration("minimal.xml");
ProducerRegistrationRequirements requirements = producerConfiguration.getRegistrationRequirements();
- assertNull(requirements);
+ assertNotNull(requirements);
+ assertFalse(requirements.requiresRegistration());
+ assertFalse(requirements.fullServiceDescriptionRequiresRegistration());
+ assertTrue(requirements.getRegistrationProperties().isEmpty());
+ assertNull(requirements.getPolicy());
}
public void testInvalidMultipleRegistrationConfiguration() throws Exception
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/BehaviorBackedServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/BehaviorBackedServiceFactory.java 2007-09-18 01:07:30 UTC (rev 8306)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/BehaviorBackedServiceFactory.java 2007-09-18 01:20:26 UTC (rev 8307)
@@ -113,6 +113,11 @@
return true;
}
+ public boolean isFailed()
+ {
+ return false;
+ }
+
public String getServiceDescriptionURL()
{
return SD_URL;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-09-18 01:07:30 UTC (rev 8306)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-09-18 01:20:26 UTC (rev 8307)
@@ -264,19 +264,20 @@
createConsumerFrom(producerInfo);
- // if the producer is marked as active, activate it fo' real! :)
- if (producerInfo.isActive())
+ try
{
- try
+ // if the producer is marked as active, activate it fo' real! :)
+ if (producerInfo.isActive())
{
activateConsumerWith(producerInfo.getId());
}
- catch (ConsumerException e)
- {
- producerInfo.setActive(false);
- updateProducerInfo(producerInfo);
- }
}
+ catch (Exception e)
+ {
+ producerInfo.setActive(false);
+ updateProducerInfo(producerInfo);
+ }
+
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-09-18 01:07:30 UTC (rev 8306)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-09-18 01:20:26 UTC (rev 8307)
@@ -250,14 +250,21 @@
{
if (!serviceFactory.isAvailable())
{
- try
+ if (!serviceFactory.isFailed())
{
- serviceFactory.start();
- refreshServices();
+ try
+ {
+ serviceFactory.start();
+ refreshServices();
+ }
+ catch (Exception e)
+ {
+ throw new ConsumerException("Couldn't start ServiceFactory", e);
+ }
}
- catch (Exception e)
+ else
{
- throw new ConsumerException("Couldn't start ServiceFactory", e);
+ throw new ConsumerException("ServiceFactory has an error condition that couldn't be recovered from.");
}
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2007-09-18 01:07:30 UTC (rev 8306)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2007-09-18 01:20:26 UTC (rev 8307)
@@ -271,13 +271,20 @@
super.startService();
producerConfiguration = configurationService.getConfiguration();
ProducerRegistrationRequirements registrationRequirements = getProducerRegistrationRequirements();
- registrationManager.setPolicy(registrationRequirements.getPolicy());
- registrationRequirements.addRegistrationPropertyChangeListeners(registrationManager);
+ if (registrationRequirements.requiresRegistration())
+ {
+ registrationManager.setPolicy(registrationRequirements.getPolicy());
+ registrationRequirements.addRegistrationPropertyChangeListeners(registrationManager);
+ }
}
protected void stopService() throws Exception
{
- getProducerRegistrationRequirements().removeRegistrationPropertyChangeListener(registrationManager);
+ ProducerRegistrationRequirements registrationRequirements = getProducerRegistrationRequirements();
+ if (registrationRequirements.requiresRegistration())
+ {
+ registrationRequirements.removeRegistrationPropertyChangeListener(registrationManager);
+ }
super.stopService();
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2007-09-18 01:07:30 UTC (rev 8306)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2007-09-18 01:20:26 UTC (rev 8307)
@@ -219,11 +219,6 @@
throw new IllegalStateException("Doesn't make sense to define a property validator without using DefaultRegistrationPolicy!");
}
- if (conf.getRegistrationRequirements() != null)
- {
- throw new IllegalStateException("ProducerConfiguration already has registration information set!");
- }
-
conf.setRegistrationRequirements(regReq);
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationImpl.java 2007-09-18 01:07:30 UTC (rev 8306)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationImpl.java 2007-09-18 01:20:26 UTC (rev 8307)
@@ -39,16 +39,16 @@
public ProducerRegistrationRequirements getRegistrationRequirements()
{
+ if (requirements == null)
+ {
+ requirements = DEFAULT_REGISTRATION_REQUIREMENTS;
+ }
+
return requirements;
}
public void setRegistrationRequirements(ProducerRegistrationRequirements requirements)
{
- if (requirements == null)
- {
- requirements = DEFAULT_REGISTRATION_REQUIREMENTS;
- }
-
this.requirements = requirements;
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2007-09-18 01:07:30 UTC (rev 8306)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2007-09-18 01:20:26 UTC (rev 8307)
@@ -23,10 +23,12 @@
package org.jboss.portal.wsrp.producer.config.impl;
+import org.jboss.logging.Logger;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.registration.RegistrationPolicy;
import org.jboss.portal.registration.RegistrationPropertyChangeListener;
import org.jboss.portal.registration.policies.DefaultRegistrationPolicy;
+import org.jboss.portal.registration.policies.DefaultRegistrationPropertyValidator;
import org.jboss.portal.registration.policies.RegistrationPropertyValidator;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
@@ -46,6 +48,8 @@
*/
public class ProducerRegistrationRequirementsImpl implements ProducerRegistrationRequirements
{
+ private final Logger log = Logger.getLogger(getClass());
+
private boolean requiresRegistration;
private boolean fullServiceDescriptionRequiresRegistration;
private transient Set listeners = new HashSet(3);
@@ -56,6 +60,7 @@
/** property name (QName) -> PropertyDescription */
private Map registrationProperties;
public final static String DEFAULT_POLICY_CLASS_NAME = "org.jboss.portal.registration.policies.DefaultRegistrationPolicy";
+ public final static String DEFAULT_VALIDATOR_CLASS_NAME = "org.jboss.portal.registration.policies.DefaultRegistrationPropertyValidator";
public ProducerRegistrationRequirementsImpl(boolean requiresMarshalling, boolean requiresRegistration, boolean fullServiceDescriptionRequiresRegistration)
{
@@ -195,10 +200,11 @@
public RegistrationPolicy getPolicy()
{
- if (policy == null)
+ if (policy == null && requiresRegistration)
{
if (policyClassName != null)
{
+ log.debug("Using registration policy: " + policyClassName);
ClassLoader loader = Thread.currentThread().getContextClassLoader();
try
{
@@ -226,37 +232,42 @@
}
else
{
- if (validatorClassName == null)
- {
- throw new IllegalArgumentException("No RegistrationPolicy was defined, was thus expecting a registration " +
- "property validator to assign to DefaultRegistrationPolicy!");
- }
-
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ log.debug("Using default registration policy: " + DEFAULT_POLICY_CLASS_NAME);
RegistrationPropertyValidator validator;
- try
+ if (validatorClassName != null)
{
- Class validatorClass = loader.loadClass(validatorClassName);
- Class expectedInterface = loader.loadClass("org.jboss.portal.registration.policies.RegistrationPropertyValidator");
- if (!expectedInterface.isAssignableFrom(validatorClass))
+ log.debug("Using registration property validator: " + validatorClassName);
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ try
{
- throw new IllegalArgumentException("Validator class does not implement RegistrationPropertyValidator!");
+ Class validatorClass = loader.loadClass(validatorClassName);
+ Class expectedInterface = loader.loadClass("org.jboss.portal.registration.policies.RegistrationPropertyValidator");
+ if (!expectedInterface.isAssignableFrom(validatorClass))
+ {
+ throw new IllegalArgumentException("Validator class does not implement RegistrationPropertyValidator!");
+ }
+ validator = (RegistrationPropertyValidator)validatorClass.newInstance();
}
- validator = (RegistrationPropertyValidator)validatorClass.newInstance();
+ catch (ClassNotFoundException e)
+ {
+ IllegalArgumentException iae = new IllegalArgumentException("Couldn't find validator class " + validatorClassName + ".");
+ iae.initCause(e);
+ throw iae;
+ }
+ catch (Exception e)
+ {
+ IllegalArgumentException iae = new IllegalArgumentException("Couldn't instantiate validator class.");
+ iae.initCause(e);
+ throw iae;
+ }
}
- catch (ClassNotFoundException e)
+ else
{
- IllegalArgumentException iae = new IllegalArgumentException("Couldn't find validator class " + validatorClassName + ".");
- iae.initCause(e);
- throw iae;
+ log.debug("Using default registration property validator: " + DEFAULT_VALIDATOR_CLASS_NAME);
+ validator = new DefaultRegistrationPropertyValidator();
}
- catch (Exception e)
- {
- IllegalArgumentException iae = new IllegalArgumentException("Couldn't instantiate validator class.");
- iae.initCause(e);
- throw iae;
- }
+
policy = new DefaultRegistrationPolicy();
((DefaultRegistrationPolicy)policy).setValidator(validator);
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractJNDIServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractJNDIServiceFactory.java 2007-09-18 01:07:30 UTC (rev 8306)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractJNDIServiceFactory.java 2007-09-18 01:20:26 UTC (rev 8307)
@@ -52,6 +52,9 @@
/** Default mapping between WSRP port type class and associated JNDI name */
private static Properties DEFAULT_FACTORY_MAPPING;
+ /** Wheter or not this ServiceFactory has an error condition */
+ protected boolean failed = false;
+
static
{
// fix-me: this is hardcoded from values from portal-wsrp-client.jar/META-INF/jboss-client.xml... NOT GOOD!
@@ -154,6 +157,11 @@
}
}
+ public boolean isFailed()
+ {
+ return failed;
+ }
+
public Properties getPortJNDIMapping()
{
return portJNDIMapping;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java 2007-09-18 01:07:30 UTC (rev 8306)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java 2007-09-18 01:20:26 UTC (rev 8307)
@@ -83,6 +83,11 @@
return delegate != null && delegate.isAvailable();
}
+ public boolean isFailed()
+ {
+ return delegate == null || delegate.isFailed();
+ }
+
public String getServiceDescriptionURL()
{
if (delegate != null)
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/PerEndpointSOAPInvokerServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/services/PerEndpointSOAPInvokerServiceFactory.java 2007-09-18 01:07:30 UTC (rev 8306)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/services/PerEndpointSOAPInvokerServiceFactory.java 2007-09-18 01:20:26 UTC (rev 8307)
@@ -133,6 +133,7 @@
{
if (isMandatoryInterface)
{
+ failed = true;
throw new IllegalStateException("Mandatory interface URLs were not properly initialized: no proper service URL for "
+ serviceClass.getName());
}
@@ -150,6 +151,6 @@
public boolean isAvailable()
{
- return !EndpointConfigurationInfo.UNSET.equals(serviceDescriptionURL) && !EndpointConfigurationInfo.UNSET.equals(markupURL);
+ return !failed && !EndpointConfigurationInfo.UNSET.equals(serviceDescriptionURL) && !EndpointConfigurationInfo.UNSET.equals(markupURL);
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java 2007-09-18 01:07:30 UTC (rev 8306)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java 2007-09-18 01:20:26 UTC (rev 8307)
@@ -24,9 +24,9 @@
package org.jboss.portal.wsrp.services;
import org.jboss.logging.Logger;
+import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.common.net.URLStreamOpeningThread;
import org.jboss.portal.common.util.ParameterValidation;
-import org.jboss.portal.common.net.URLStreamOpeningThread;
-import org.jboss.portal.common.io.IOTools;
import org.xml.sax.InputSource;
import javax.wsdl.Definition;
@@ -91,19 +91,21 @@
"find the WSRP services definition");
iae.initCause(e);
available = false;
+ failed = true;
throw iae;
}
catch (Exception e)
{
log.info("Couldn't access WSDL information. Service won't be available", e);
available = false;
+ failed = true;
throw e;
}
}
public boolean isAvailable()
{
- return available;
+ return available && !failed;
}
private void initServices() throws MalformedURLException
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java 2007-09-18 01:07:30 UTC (rev 8306)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java 2007-09-18 01:20:26 UTC (rev 8307)
@@ -36,6 +36,8 @@
boolean isAvailable();
+ boolean isFailed();
+
String getServiceDescriptionURL();
String getMarkupURL();
Modified: trunk/wsrp/src/resources/portal-wsrp-sar/conf/producer/config.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/conf/producer/config.xml 2007-09-18 01:07:30 UTC (rev 8306)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/conf/producer/config.xml 2007-09-18 01:20:26 UTC (rev 8307)
@@ -24,9 +24,12 @@
<!DOCTYPE producer-configuration PUBLIC "-//JBoss Portal//DTD WSRP Local Producer Configuration 2.6//EN"
"http://www.jboss.org/portal/dtd/jboss-wsrp-producer_2_6.dtd">
+<!-- Configuration using registration with default registration property validator. -->
<producer-configuration>
<registration-configuration fullServiceDescriptionRequiresRegistration="true">
<registration-property-validator>org.jboss.portal.registration.policies.DefaultRegistrationPropertyValidator</registration-property-validator>
</registration-configuration>
</producer-configuration>
+ <!-- Configuration without registration -->
+ <!--<producer-configuration/>-->
\ No newline at end of file
18 years, 7 months
JBoss Portal SVN: r8306 - in branches/JBoss_Portal_Branch_2_6/wsrp/src: main/org/jboss/portal/test/wsrp/framework/support and 6 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-09-17 21:07:30 -0400 (Mon, 17 Sep 2007)
New Revision: 8306
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/BehaviorBackedServiceFactory.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationImpl.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractJNDIServiceFactory.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/PerEndpointSOAPInvokerServiceFactory.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/producer/config.xml
Log:
- JBPORTAL-1700
+ ConsumerRegistryService should be able to start even if a consumer throws an Exception.
+ Added ServiceFactory.isFailed method to avoid infinite loop if a consumer is not available and fails to start.
+ Now uses a default validator for registration properties if none was provided (to allow for empty registration configurations.
+ RegistrationPolicy is not initialized anymore if registration is not required.
+ Do not initialize RegistrationManager if registration is not required.
+ Updated ProducerConfigurationTestCase.
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java 2007-09-18 00:10:43 UTC (rev 8305)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java 2007-09-18 01:07:30 UTC (rev 8306)
@@ -102,13 +102,18 @@
Map properties = requirements.getRegistrationProperties();
assertNotNull(properties);
assertTrue(properties.isEmpty());
+ assertNotNull(requirements.getPolicy());
}
public void testMinimalUnmarshalling() throws Exception
{
ProducerConfiguration producerConfiguration = getProducerConfiguration("minimal.xml");
ProducerRegistrationRequirements requirements = producerConfiguration.getRegistrationRequirements();
- assertNull(requirements);
+ assertNotNull(requirements);
+ assertFalse(requirements.requiresRegistration());
+ assertFalse(requirements.fullServiceDescriptionRequiresRegistration());
+ assertTrue(requirements.getRegistrationProperties().isEmpty());
+ assertNull(requirements.getPolicy());
}
public void testInvalidMultipleRegistrationConfiguration() throws Exception
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/BehaviorBackedServiceFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/BehaviorBackedServiceFactory.java 2007-09-18 00:10:43 UTC (rev 8305)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/BehaviorBackedServiceFactory.java 2007-09-18 01:07:30 UTC (rev 8306)
@@ -113,6 +113,11 @@
return true;
}
+ public boolean isFailed()
+ {
+ return false;
+ }
+
public String getServiceDescriptionURL()
{
return SD_URL;
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-09-18 00:10:43 UTC (rev 8305)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-09-18 01:07:30 UTC (rev 8306)
@@ -264,19 +264,20 @@
createConsumerFrom(producerInfo);
- // if the producer is marked as active, activate it fo' real! :)
- if (producerInfo.isActive())
+ try
{
- try
+ // if the producer is marked as active, activate it fo' real! :)
+ if (producerInfo.isActive())
{
activateConsumerWith(producerInfo.getId());
}
- catch (ConsumerException e)
- {
- producerInfo.setActive(false);
- updateProducerInfo(producerInfo);
- }
}
+ catch (Exception e)
+ {
+ producerInfo.setActive(false);
+ updateProducerInfo(producerInfo);
+ }
+
}
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-09-18 00:10:43 UTC (rev 8305)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-09-18 01:07:30 UTC (rev 8306)
@@ -250,14 +250,21 @@
{
if (!serviceFactory.isAvailable())
{
- try
+ if (!serviceFactory.isFailed())
{
- serviceFactory.start();
- refreshServices();
+ try
+ {
+ serviceFactory.start();
+ refreshServices();
+ }
+ catch (Exception e)
+ {
+ throw new ConsumerException("Couldn't start ServiceFactory", e);
+ }
}
- catch (Exception e)
+ else
{
- throw new ConsumerException("Couldn't start ServiceFactory", e);
+ throw new ConsumerException("ServiceFactory has an error condition that couldn't be recovered from.");
}
}
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2007-09-18 00:10:43 UTC (rev 8305)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2007-09-18 01:07:30 UTC (rev 8306)
@@ -271,13 +271,20 @@
super.startService();
producerConfiguration = configurationService.getConfiguration();
ProducerRegistrationRequirements registrationRequirements = getProducerRegistrationRequirements();
- registrationManager.setPolicy(registrationRequirements.getPolicy());
- registrationRequirements.addRegistrationPropertyChangeListeners(registrationManager);
+ if (registrationRequirements.requiresRegistration())
+ {
+ registrationManager.setPolicy(registrationRequirements.getPolicy());
+ registrationRequirements.addRegistrationPropertyChangeListeners(registrationManager);
+ }
}
protected void stopService() throws Exception
{
- getProducerRegistrationRequirements().removeRegistrationPropertyChangeListener(registrationManager);
+ ProducerRegistrationRequirements registrationRequirements = getProducerRegistrationRequirements();
+ if (registrationRequirements.requiresRegistration())
+ {
+ registrationRequirements.removeRegistrationPropertyChangeListener(registrationManager);
+ }
super.stopService();
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2007-09-18 00:10:43 UTC (rev 8305)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2007-09-18 01:07:30 UTC (rev 8306)
@@ -219,11 +219,6 @@
throw new IllegalStateException("Doesn't make sense to define a property validator without using DefaultRegistrationPolicy!");
}
- if (conf.getRegistrationRequirements() != null)
- {
- throw new IllegalStateException("ProducerConfiguration already has registration information set!");
- }
-
conf.setRegistrationRequirements(regReq);
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationImpl.java 2007-09-18 00:10:43 UTC (rev 8305)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationImpl.java 2007-09-18 01:07:30 UTC (rev 8306)
@@ -39,16 +39,16 @@
public ProducerRegistrationRequirements getRegistrationRequirements()
{
+ if (requirements == null)
+ {
+ requirements = DEFAULT_REGISTRATION_REQUIREMENTS;
+ }
+
return requirements;
}
public void setRegistrationRequirements(ProducerRegistrationRequirements requirements)
{
- if (requirements == null)
- {
- requirements = DEFAULT_REGISTRATION_REQUIREMENTS;
- }
-
this.requirements = requirements;
}
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2007-09-18 00:10:43 UTC (rev 8305)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2007-09-18 01:07:30 UTC (rev 8306)
@@ -23,10 +23,12 @@
package org.jboss.portal.wsrp.producer.config.impl;
+import org.jboss.logging.Logger;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.registration.RegistrationPolicy;
import org.jboss.portal.registration.RegistrationPropertyChangeListener;
import org.jboss.portal.registration.policies.DefaultRegistrationPolicy;
+import org.jboss.portal.registration.policies.DefaultRegistrationPropertyValidator;
import org.jboss.portal.registration.policies.RegistrationPropertyValidator;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
@@ -46,6 +48,8 @@
*/
public class ProducerRegistrationRequirementsImpl implements ProducerRegistrationRequirements
{
+ private final Logger log = Logger.getLogger(getClass());
+
private boolean requiresRegistration;
private boolean fullServiceDescriptionRequiresRegistration;
private transient Set listeners = new HashSet(3);
@@ -56,6 +60,7 @@
/** property name (QName) -> PropertyDescription */
private Map registrationProperties;
public final static String DEFAULT_POLICY_CLASS_NAME = "org.jboss.portal.registration.policies.DefaultRegistrationPolicy";
+ public final static String DEFAULT_VALIDATOR_CLASS_NAME = "org.jboss.portal.registration.policies.DefaultRegistrationPropertyValidator";
public ProducerRegistrationRequirementsImpl(boolean requiresMarshalling, boolean requiresRegistration, boolean fullServiceDescriptionRequiresRegistration)
{
@@ -195,10 +200,11 @@
public RegistrationPolicy getPolicy()
{
- if (policy == null)
+ if (policy == null && requiresRegistration)
{
if (policyClassName != null)
{
+ log.debug("Using registration policy: " + policyClassName);
ClassLoader loader = Thread.currentThread().getContextClassLoader();
try
{
@@ -226,37 +232,42 @@
}
else
{
- if (validatorClassName == null)
- {
- throw new IllegalArgumentException("No RegistrationPolicy was defined, was thus expecting a registration " +
- "property validator to assign to DefaultRegistrationPolicy!");
- }
-
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ log.debug("Using default registration policy: " + DEFAULT_POLICY_CLASS_NAME);
RegistrationPropertyValidator validator;
- try
+ if (validatorClassName != null)
{
- Class validatorClass = loader.loadClass(validatorClassName);
- Class expectedInterface = loader.loadClass("org.jboss.portal.registration.policies.RegistrationPropertyValidator");
- if (!expectedInterface.isAssignableFrom(validatorClass))
+ log.debug("Using registration property validator: " + validatorClassName);
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ try
{
- throw new IllegalArgumentException("Validator class does not implement RegistrationPropertyValidator!");
+ Class validatorClass = loader.loadClass(validatorClassName);
+ Class expectedInterface = loader.loadClass("org.jboss.portal.registration.policies.RegistrationPropertyValidator");
+ if (!expectedInterface.isAssignableFrom(validatorClass))
+ {
+ throw new IllegalArgumentException("Validator class does not implement RegistrationPropertyValidator!");
+ }
+ validator = (RegistrationPropertyValidator)validatorClass.newInstance();
}
- validator = (RegistrationPropertyValidator)validatorClass.newInstance();
+ catch (ClassNotFoundException e)
+ {
+ IllegalArgumentException iae = new IllegalArgumentException("Couldn't find validator class " + validatorClassName + ".");
+ iae.initCause(e);
+ throw iae;
+ }
+ catch (Exception e)
+ {
+ IllegalArgumentException iae = new IllegalArgumentException("Couldn't instantiate validator class.");
+ iae.initCause(e);
+ throw iae;
+ }
}
- catch (ClassNotFoundException e)
+ else
{
- IllegalArgumentException iae = new IllegalArgumentException("Couldn't find validator class " + validatorClassName + ".");
- iae.initCause(e);
- throw iae;
+ log.debug("Using default registration property validator: " + DEFAULT_VALIDATOR_CLASS_NAME);
+ validator = new DefaultRegistrationPropertyValidator();
}
- catch (Exception e)
- {
- IllegalArgumentException iae = new IllegalArgumentException("Couldn't instantiate validator class.");
- iae.initCause(e);
- throw iae;
- }
+
policy = new DefaultRegistrationPolicy();
((DefaultRegistrationPolicy)policy).setValidator(validator);
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractJNDIServiceFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractJNDIServiceFactory.java 2007-09-18 00:10:43 UTC (rev 8305)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractJNDIServiceFactory.java 2007-09-18 01:07:30 UTC (rev 8306)
@@ -52,6 +52,9 @@
/** Default mapping between WSRP port type class and associated JNDI name */
private static Properties DEFAULT_FACTORY_MAPPING;
+ /** Wheter or not this ServiceFactory has an error condition */
+ protected boolean failed = false;
+
static
{
// fix-me: this is hardcoded from values from portal-wsrp-client.jar/META-INF/jboss-client.xml... NOT GOOD!
@@ -154,6 +157,11 @@
}
}
+ public boolean isFailed()
+ {
+ return failed;
+ }
+
public Properties getPortJNDIMapping()
{
return portJNDIMapping;
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java 2007-09-18 00:10:43 UTC (rev 8305)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/CachingServiceFactory.java 2007-09-18 01:07:30 UTC (rev 8306)
@@ -83,6 +83,11 @@
return delegate != null && delegate.isAvailable();
}
+ public boolean isFailed()
+ {
+ return delegate == null || delegate.isFailed();
+ }
+
public String getServiceDescriptionURL()
{
if (delegate != null)
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/PerEndpointSOAPInvokerServiceFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/PerEndpointSOAPInvokerServiceFactory.java 2007-09-18 00:10:43 UTC (rev 8305)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/PerEndpointSOAPInvokerServiceFactory.java 2007-09-18 01:07:30 UTC (rev 8306)
@@ -133,6 +133,7 @@
{
if (isMandatoryInterface)
{
+ failed = true;
throw new IllegalStateException("Mandatory interface URLs were not properly initialized: no proper service URL for "
+ serviceClass.getName());
}
@@ -150,6 +151,6 @@
public boolean isAvailable()
{
- return !EndpointConfigurationInfo.UNSET.equals(serviceDescriptionURL) && !EndpointConfigurationInfo.UNSET.equals(markupURL);
+ return !failed && !EndpointConfigurationInfo.UNSET.equals(serviceDescriptionURL) && !EndpointConfigurationInfo.UNSET.equals(markupURL);
}
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java 2007-09-18 00:10:43 UTC (rev 8305)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java 2007-09-18 01:07:30 UTC (rev 8306)
@@ -24,9 +24,9 @@
package org.jboss.portal.wsrp.services;
import org.jboss.logging.Logger;
+import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.common.net.URLStreamOpeningThread;
import org.jboss.portal.common.util.ParameterValidation;
-import org.jboss.portal.common.net.URLStreamOpeningThread;
-import org.jboss.portal.common.io.IOTools;
import org.xml.sax.InputSource;
import javax.wsdl.Definition;
@@ -91,19 +91,21 @@
"find the WSRP services definition");
iae.initCause(e);
available = false;
+ failed = true;
throw iae;
}
catch (Exception e)
{
log.info("Couldn't access WSDL information. Service won't be available", e);
available = false;
+ failed = true;
throw e;
}
}
public boolean isAvailable()
{
- return available;
+ return available && !failed;
}
private void initServices() throws MalformedURLException
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java 2007-09-18 00:10:43 UTC (rev 8305)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/ServiceFactory.java 2007-09-18 01:07:30 UTC (rev 8306)
@@ -36,6 +36,8 @@
boolean isAvailable();
+ boolean isFailed();
+
String getServiceDescriptionURL();
String getMarkupURL();
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/producer/config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/producer/config.xml 2007-09-18 00:10:43 UTC (rev 8305)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/producer/config.xml 2007-09-18 01:07:30 UTC (rev 8306)
@@ -24,9 +24,12 @@
<!DOCTYPE producer-configuration PUBLIC "-//JBoss Portal//DTD WSRP Local Producer Configuration 2.6//EN"
"http://www.jboss.org/portal/dtd/jboss-wsrp-producer_2_6.dtd">
+<!-- Configuration using registration with default registration property validator. -->
<producer-configuration>
<registration-configuration fullServiceDescriptionRequiresRegistration="true">
<registration-property-validator>org.jboss.portal.registration.policies.DefaultRegistrationPropertyValidator</registration-property-validator>
</registration-configuration>
</producer-configuration>
+ <!-- Configuration without registration -->
+ <!--<producer-configuration/>-->
\ No newline at end of file
18 years, 7 months