/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: JAXRPCUtil.java,v 1.5 2008/06/25 05:43:34 qcheng Exp $
*
*/
/*
* Portions Copyrighted [2011] [ForgeRock AS]
*/
/**
* The class <code>JAXRPCUtil</code> provides functions to get JAXRPC stubs to
* a valid Identity Server. The function
* <code>getRemoteStub(String serviceName)</code> returns a JAXRPC stub to the
* service. It is expected that the service caches the stub and re-uses it until
* the server has failed. Upon server failure, the service needs to call the
* function <code>serverFailed
* (String serviceName)</code>, and the next call
* to <code>
* getRemoteStub(String serviceName)</code> will check for next valid
* server and will return a stub that is currently active or throws
* <code>java.rmi.RemoteException</code> if no servers are available.
*/
/**
* Returns a valid JAXRPC end point for the given service name. If no valid
* servers are found, it throws <code>java.rmi.RemoteException</code>.
*/
throws RemoteException {
serverFailed = false;
}
return (answer);
}
/**
* Sets the service to be failed.
*/
serverFailed = true;
} else {
// Could be serviceName
}
}
throws RemoteException {
// Add to cache
return (stub);
}
if (debug.messageEnabled()) {
}
// Obtaining the stub for JAX-RPC and setting the endpoint URL
try {
// Due to compilation errors, this function has been
// made to use reflections
"com.sun.identity.jaxrpc.IdentityManagementServices_Impl");
// Obtain the method "getSMSObjectIFPort" and invoke it
} // %%% Add other service names here
// Obtain the stub to be returned
} catch (ClassNotFoundException cnfe) {
if (debug.warningEnabled()) {
+ "IdentityManagementServices_Impl", cnfe);
}
} catch (InstantiationException ne) {
if (debug.warningEnabled()) {
+ "IdentityManagementServices_Impl", ne);
}
} catch (IllegalAccessException iae) {
if (debug.warningEnabled()) {
+ "IdentityManagementServices_Impl", iae);
}
} catch (Throwable t) {
if (debug.warningEnabled()) {
}
}
// Set the remote URL for the service
if (s != null) {
}
return (s);
}
}