/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* or packager/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
/**
*Concrete implementation of the JSR 88 DeploymentFactory interface.
* @author dochez
* @author tjquinn
*/
new LocalStringManagerImpl(SunDeploymentFactory.class);
"enterprise.deployapi.spi.DMgrnotconnected", // NOI18N
"Deployment Manager is not connected to J2EE Resources"); // NOI18N
// URI String that this factory can handle. May need to be rebuilt.
//The following URISTRING is what we supported in PE Beta. Keeping it for
//backward compatibility
//The following URISTRINNG is what we use for PE FCS and in the future
// All the registered mangers are shared by all instances of the Factory
private static final Logger sLogger=LogDomains.getLogger(DeploymentUtils.class, LogDomains.DPL_LOGGER);
/** Creates a new instance of SunDeploymentFactory */
public SunDeploymentFactory() {
}
/** Return a <tt>connected</tt> DeploymentManager instance.
*
* @param uri The URI that specifies the connection parameters
* @param username An optional username (may be <tt>null</tt> if
* no authentication is required for this platform).
* @param password An optional password (may be <tt>null</yy> if
* no authentication is required for this platform).
* @return A ready DeploymentManager instance.
* @throws DeploymentManagerCreationException occurs when a
* DeploymentManager could not be returned (server down,
* unable to authenticate, etc).
*/
public DeploymentManager getDeploymentManager(String uri, String username, String password) throws DeploymentManagerCreationException {
if (handlesURI(uri)) {
try {
"enterprise.deployapi.spi.wronghostidentifier",
throw e;
}
try {
return answer;
} catch(Throwable t) {
DeploymentManagerCreationException e = new DeploymentManagerCreationException(xlocalStrings.getLocalString(
"enterprise.deployapi.spi.exceptionwhileconnecting", //NOI18N
e.initCause(t);
throw e;
}
} else {
return null;
}
}
/** Return a <tt>disconnected</tt> DeploymentManager instance.
*
* @param uri the uri of the DeploymentManager to return.
* @return A DeploymentManager <tt>disconnected</tt> instance.
* @throws DeploymentManagerCreationException occurs if the
* DeploymentManager could not be created.
*/
public DeploymentManager getDisconnectedDeploymentManager(String uri) throws DeploymentManagerCreationException {
if (handlesURI(uri)) {
return new SunDeploymentManager();
} else {
return null;
}
}
/** Provide a string with the name of this vendor's DeploymentManager.
* @return the name of the vendor's DeploymentManager.
*/
return xlocalStrings.getLocalString(
"enterprise.deployapi.spi.DisplayName",
"Sun Java System Application Server");
}
/** Provide a string identifying version of this vendor's
* DeploymentManager.
* @return the name of the vendor's DeploymentManager.
*/
return xlocalStrings.getLocalString(
"enterprise.deployapi.spi.ProductVersion", "9.0");
}
/** Tests whether this factory can create a DeploymentManager
* object based on the specificed URI. This does not indicate
* whether such an attempt will be successful, only whether the
* factory can handle the uri.
* @param uri The uri to check
* @return <tt>true</tt> if the factory can handle the uri.
*/
}
try {
}
}
return false;
}
/**
*/
targetURI = supportedURIs[i];
}
}
//if the URI does not contain DEFAULT_URISTRINNG or PE_BETA_URISTRING,
//then the URI is not valid.
"enterprise.deployapi.spi.invaliduri", // NOI18N
"Invalid URI")); // NOI18N
}
} else {
"enterprise.deployapi.spi.invaliduri", // NOI18N
"Invalid URI")); // NOI18N
}
} else {
}
} else {
}
}
}
}
return sci;
}
}