diff options
Diffstat (limited to 'plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin')
9 files changed, 0 insertions, 885 deletions
diff --git a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/bindings/AbstractJNDIBindingsHelper.java b/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/bindings/AbstractJNDIBindingsHelper.java deleted file mode 100644 index 8d3de51a4..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/bindings/AbstractJNDIBindingsHelper.java +++ /dev/null @@ -1,99 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005,2006 IBM Corporation - * Licensed Material - Property of IBM. All rights reserved. - * US Government Users Restricted Rights - Use, duplication or disclosure v1.0 - * restricted by GSA ADP Schedule Contract with IBM Corp. - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.core.internal.bindings; - -import org.eclipse.core.resources.IProject; -import org.eclipse.jst.j2ee.common.ResourceEnvRef; -import org.eclipse.jst.j2ee.common.ResourceRef; -import org.eclipse.jst.j2ee.common.SecurityRoleRef; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.ejb.ContainerManagedEntity; -import org.eclipse.jst.j2ee.ejb.EJBJar; -import org.eclipse.jst.j2ee.ejb.EnterpriseBean; -import org.eclipse.jst.j2ee.webapplication.WebApp; - -/** - * Default implementation of {@link IJNDIBindingsHelper}. Clients should extend this class for their - * implementations. - * - */ -public class AbstractJNDIBindingsHelper implements IJNDIBindingsHelper { - - /** - * Default implementation returns <code>false</code>. - */ - public boolean appliesFor(IProject project) { - return false; - } - - /** - * Default implementation returns <code>false</code>. - */ - public boolean appliesFor(Archive archive) { - return false; - } - - /** - * Default implementation returns <code>object.toString()</code>. - */ - public String getJNDIName(Object object) { - return object.toString(); - } - - /** - * Default implementation returns <code>bean.getName()</code>. - */ - public String getJNDIName(EnterpriseBean bean) { - return bean.getName(); - } - - /** - * Default implementation returns <code>resourceRef.getName()</code>. - */ - public String getJNDINameForRef(EnterpriseBean bean, ResourceRef resourceRef) { - return resourceRef.getName(); - } - - /** - * Default implementation returns <code>resourceEnvRef.getName()</code>. - */ - public String getJNDINameForRef(EnterpriseBean bean, ResourceEnvRef resourceEnvRef) { - return resourceEnvRef.getName(); - } - - /** - * Default implementation returns <code>securityRoleRef.getName()</code>. - */ - public String getJNDINameForRef(EnterpriseBean bean, SecurityRoleRef securityRoleRef) { - return securityRoleRef.getName(); - } - - /** - * Default implementation returns <code>resourceRef.getName()</code>. - */ - public String getJNDINameForRef(WebApp webApp, ResourceRef resourceRef) { - return resourceRef.getName(); - } - - /** - * Default implementation returns <code>resourceEnvRef.getName()</code>. - */ - public String getJNDINameForRef(WebApp webApp, ResourceEnvRef resourceEnvRef) { - return resourceEnvRef.getName(); - } - - /** - * Default implementation returns <code>((EJBJar) bean.eContainer()).getDisplayName()</code>. - */ - public String getJNDINameForDefaultDataSource(ContainerManagedEntity bean) { - return ((EJBJar) bean.eContainer()).getDisplayName(); - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/bindings/IJNDIBindingsHelper.java b/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/bindings/IJNDIBindingsHelper.java deleted file mode 100644 index fa6a51264..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/bindings/IJNDIBindingsHelper.java +++ /dev/null @@ -1,117 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005,2006 IBM Corporation - * Licensed Material - Property of IBM. All rights reserved. - * US Government Users Restricted Rights - Use, duplication or disclosure v1.0 - * restricted by GSA ADP Schedule Contract with IBM Corp. - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.core.internal.bindings; - -import org.eclipse.core.resources.IProject; -import org.eclipse.jst.j2ee.common.ResourceEnvRef; -import org.eclipse.jst.j2ee.common.ResourceRef; -import org.eclipse.jst.j2ee.common.SecurityRoleRef; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.ejb.ContainerManagedEntity; -import org.eclipse.jst.j2ee.ejb.EnterpriseBean; -import org.eclipse.jst.j2ee.webapplication.WebApp; - -/** - * This is used to load jndi bindings from various J2EE artifacts. Clients should acquire - * IBindingsHelper from the {@link JNDIBindingsHelperManager}. - */ -public interface IJNDIBindingsHelper { - - /** - * Clients should not call this method. This method is used by the - * {@link JNDIBindingsHelperManager}. - * - * @param project - * @return true if this {@link IJNDIBindingsHelper} can be used to load bindings for specified - * project. - */ - public boolean appliesFor(IProject project); - - /** - * Clients should not call this method. This method is used by the - * {@link JNDIBindingsHelperManager}. - * - * @param project - * @return true if this {@link IJNDIBindingsHelper} can be used to load bindings for specified - * archive. - */ - public boolean appliesFor(Archive archive); - - /** - * Returns the specified bean's JNDI name. - * - * @param bean - * @return the specified bean's JNDI name. - */ - public String getJNDIName(EnterpriseBean bean); - - /** - * Returns the JNDI name for the specified CMP's default datasource. - * - * @param bean - * @return the JNDI name for the specified CMP's default datasource. - */ - public String getJNDINameForDefaultDataSource(ContainerManagedEntity bean); - - /** - * Returns the specified bean's resource reference's JNDI name. - * - * @param bean - * @param resourceRef - * @return the specified bean's resource reference's JNDI name. - */ - public String getJNDINameForRef(EnterpriseBean bean, ResourceRef resourceRef); - - /** - * Returns the specified bean's resource environment reference's JNDI name. - * - * @param bean - * @param resourceEnvRef - * @return the specified bean's resource environment reference's JNDI name. - */ - public String getJNDINameForRef(EnterpriseBean bean, ResourceEnvRef resourceEnvRef); - - /** - * Returns the specified bean's security role referenc's JNDI name. - * - * @param bean - * @param securityRoleRef - * @return the specified bean's security role referenc's JNDI name. - */ - public String getJNDINameForRef(EnterpriseBean bean, SecurityRoleRef securityRoleRef); - - /** - * Reuturns the specified web application's resource reference's JNDI name. - * - * @param webApp - * @param resourceRef - * @return the specified web application's resource reference's JNDI name. - */ - public String getJNDINameForRef(WebApp webApp, ResourceRef resourceRef); - - /** - * Returns the specified web application's resource environment reference's JNDI name. - * - * @param webApp - * @param resourceEnvRef - * @return the specified web application's resource environment reference's JNDI name. - */ - public String getJNDINameForRef(WebApp webApp, ResourceEnvRef resourceEnvRef); - - /** - * Returns the specified Object's JNDI name. This method should only be used if none of the - * others apply, as it will likely be inefficient due to instanceof checks. - * - * @param obj - * @return the specified Object's JNDI name. - */ - public String getJNDIName(Object obj); - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/bindings/JNDIBindingsHelperManager.java b/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/bindings/JNDIBindingsHelperManager.java deleted file mode 100644 index 7a8538797..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/bindings/JNDIBindingsHelperManager.java +++ /dev/null @@ -1,150 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005,2006 IBM Corporation - * Licensed Material - Property of IBM. All rights reserved. - * US Government Users Restricted Rights - Use, duplication or disclosure v1.0 - * restricted by GSA ADP Schedule Contract with IBM Corp. - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.core.internal.bindings; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.jem.util.RegistryReader; -import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive; -import org.eclipse.jst.j2ee.core.internal.plugin.J2EECorePlugin; - -/** - * This class is not intended to be subclasses - * - */ -public class JNDIBindingsHelperManager { - - private List allHelpers; - private IJNDIBindingsHelper defaultHelper; - private static final int TYPE_PROJECT = 0; - private static final int TYPE_ARCHIVE = 1; - - private static JNDIBindingsHelperManager instance = null; - - /** - * Returns the singleton instance. - * - * @return the singleton instance. - */ - public static JNDIBindingsHelperManager getInstance() { - if (instance == null) { - instance = new JNDIBindingsHelperManager(); - } - return instance; - } - - /** - * Returns an array of bindings helpers applicable for the specified project. If no registered - * bindings helpers apply, the returned array will contain a default bindings helper. - * - * @param project - * @return - */ - public IJNDIBindingsHelper[] getBindingsHelpers(IProject project) { - return getBindingsHelpers(TYPE_PROJECT, project); - } - - /** - * Returns an array of bindings helpers applicable for the specified archive. If no registered - * bindings helpers apply, the returned array will contain a default bindings helper. - * - * @param project - * @return - */ - public IJNDIBindingsHelper[] getBindingsHelpers(Archive archive) { - return getBindingsHelpers(TYPE_ARCHIVE, archive); - } - - private IJNDIBindingsHelper[] getBindingsHelpers(int type, Object obj) { - List helpers = getHelpers(); - List appliesHelpers = new ArrayList(); - IJNDIBindingsHelper helper = null; - for (int i = 0; i < helpers.size(); i++) { - helper = (IJNDIBindingsHelper) helpers.get(i); - if ((TYPE_PROJECT == type && helper.appliesFor((IProject) obj)) || (TYPE_ARCHIVE == type && helper.appliesFor((Archive) obj))) { - appliesHelpers.add(helper); - } - } - if (appliesHelpers.size() == 0) { - appliesHelpers.add(getDefaultHelper()); - } - - IJNDIBindingsHelper[] helpersArray = new IJNDIBindingsHelper[appliesHelpers.size()]; - for (int i = 0; i < helpersArray.length; i++) { - helpersArray[i] = (IJNDIBindingsHelper) appliesHelpers.get(i); - } - - return helpersArray; - } - - private IJNDIBindingsHelper getDefaultHelper() { - if (null == defaultHelper) { - defaultHelper = new AbstractJNDIBindingsHelper() { - public boolean appliesFor(IProject project) { - return true; - } - - public boolean appliesFor(Archive archive) { - return true; - } - }; - } - return defaultHelper; - } - - private List getHelpers() { - if (null == allHelpers) { - BindingsHelperRegistry registry = new BindingsHelperRegistry(); - registry.readRegistry(); - allHelpers = registry.getHelpers(); - } - return allHelpers; - } - - - protected String TAG_J2EE_BINDINGS_HELPER = "jndiBindingsHelpers"; //$NON-NLS-1$ - - private class BindingsHelperRegistry extends RegistryReader { - - private String ATT_CLASS = "class"; //$NON-NLS-1$ - private String TAG_BINDINGS_HELPER = "jndiBindingsHelper"; //$NON-NLS-1$ - - private List helpers = new ArrayList(); - - private BindingsHelperRegistry() { - super(J2EECorePlugin.PLUGIN_ID, TAG_J2EE_BINDINGS_HELPER); - } - - public boolean readElement(IConfigurationElement element) { - if (TAG_BINDINGS_HELPER.equals(element.getName())) { - try { - addHelper((IJNDIBindingsHelper) element.createExecutableExtension(ATT_CLASS)); - } catch (CoreException e) { - e.printStackTrace(); - return false; - } - return true; - } - return false; - } - - public List getHelpers() { - return helpers; - } - - private void addHelper(IJNDIBindingsHelper helper) { - helpers.add(helper); - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/Assert.java b/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/Assert.java deleted file mode 100644 index 192be2fb2..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/Assert.java +++ /dev/null @@ -1,110 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.core.internal.plugin; - -/** - * <code>Assert</code> is useful for for embedding runtime sanity checks - * in code. - * The predicate methods all test a condition and throw some - * type of unchecked exception if the condition does not hold. - * <p> - * Assertion failure exceptions, like most runtime exceptions, are - * thrown when something is misbehaving. Assertion failures are invariably - * unspecified behavior; consequently, clients should never rely on - * these being thrown (and certainly should not being catching them - * specifically). - * </p> - */ -public final class Assert { - /* This class is not intended to be instantiated. */ - private Assert() { - // not allowed - } - - /** Asserts that an argument is legal. If the given boolean is - * not <code>true</code>, an <code>IllegalArgumentException</code> - * is thrown. - * - * @param expression the outcode of the check - * @return <code>true</code> if the check passes (does not return - * if the check fails) - * @exception IllegalArgumentException if the legality test failed - */ - public static boolean isLegal(boolean expression) { - return isLegal(expression, ""); //$NON-NLS-1$ - } - - /** Asserts that an argument is legal. If the given boolean is - * not <code>true</code>, an <code>IllegalArgumentException</code> - * is thrown. - * The given message is included in that exception, to aid debugging. - * - * @param expression the outcode of the check - * @param message the message to include in the exception - * @return <code>true</code> if the check passes (does not return - * if the check fails) - * @exception IllegalArgumentException if the legality test failed - */ - public static boolean isLegal(boolean expression, String message) { - if (!expression) - throw new IllegalArgumentException(message); - return expression; - } - - /** Asserts that the given object is not <code>null</code>. If this - * is not the case, some kind of unchecked exception is thrown. - * - * @param object the value to test - * @exception IllegalArgumentException if the object is <code>null</code> - */ - public static void isNotNull(Object object) { - isNotNull(object, ""); //$NON-NLS-1$ - } - - /** Asserts that the given object is not <code>null</code>. If this - * is not the case, some kind of unchecked exception is thrown. - * The given message is included in that exception, to aid debugging. - * - * @param object the value to test - * @param message the message to include in the exception - * @exception IllegalArgumentException if the object is <code>null</code> - */ - public static void isNotNull(Object object, String message) { - if (object == null) - throw new AssertionFailedException("null argument:" + message); //$NON-NLS-1$ - } - - /** Asserts that the given boolean is <code>true</code>. If this - * is not the case, some kind of unchecked exception is thrown. - * - * @param expression the outcode of the check - * @return <code>true</code> if the check passes (does not return - * if the check fails) - */ - public static boolean isTrue(boolean expression) { - return isTrue(expression, ""); //$NON-NLS-1$ - } - - /** Asserts that the given boolean is <code>true</code>. If this - * is not the case, some kind of unchecked exception is thrown. - * The given message is included in that exception, to aid debugging. - * - * @param expression the outcode of the check - * @param message the message to include in the exception - * @return <code>true</code> if the check passes (does not return - * if the check fails) - */ - public static boolean isTrue(boolean expression, String message) { - if (!expression) - throw new AssertionFailedException("assertion failed: " + message); //$NON-NLS-1$ - return expression; - } -} diff --git a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/AssertionFailedException.java b/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/AssertionFailedException.java deleted file mode 100644 index 3f0730218..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/AssertionFailedException.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.core.internal.plugin; - -/** - * <code>AssertionFailedException</code> is a runtime exception thrown - * by some of the methods in <code>Assert</code>. - * <p> - * This class is not declared public to prevent some misuses; programs that catch - * or otherwise depend on assertion failures are susceptible to unexpected - * breakage when assertions in the code are added or removed. - * </p> - */ -/* package */ -class AssertionFailedException extends RuntimeException { - /** - * All serializable objects should have a stable serialVersionUID - */ - private static final long serialVersionUID = 1L; - - /** Constructs a new exception with the given message. - */ - public AssertionFailedException(String detail) { - super(detail); - } -} diff --git a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/CatalogJ2EEXmlDtDEntityResolver.java b/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/CatalogJ2EEXmlDtDEntityResolver.java deleted file mode 100644 index eeb4aff76..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/CatalogJ2EEXmlDtDEntityResolver.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.core.internal.plugin; - -import java.io.IOException; - -import org.eclipse.jst.j2ee.internal.xml.J2EEXmlDtDEntityResolver; -import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver; -import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin; -import org.xml.sax.InputSource; - -public class CatalogJ2EEXmlDtDEntityResolver extends J2EEXmlDtDEntityResolver { - - private URIResolver uriResolver; - - public CatalogJ2EEXmlDtDEntityResolver() { - } - - public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) throws IOException, org.xml.sax.SAXException { - if (uriResolver == null) { - uriResolver = URIResolverPlugin.createResolver(); - } - String uri = uriResolver.resolve(null, publicId, systemId); - if (null != uri) { - InputSource result = new InputSource(uri); - result.setPublicId(publicId); - // force the encoding to be UTF8 - result.setEncoding("UTF-8"); //$NON-NLS-1$ - return result; - } - return super.resolveEntity(publicId, systemId); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/EclipseEJBModelExtenderProvider.java b/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/EclipseEJBModelExtenderProvider.java deleted file mode 100644 index 764522d05..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/EclipseEJBModelExtenderProvider.java +++ /dev/null @@ -1,160 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -/* - * Created on Oct 29, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -package org.eclipse.jst.j2ee.core.internal.plugin; - -import java.util.SortedSet; -import java.util.TreeSet; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.jem.util.RegistryReader; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jst.j2ee.internal.EjbModuleExtensionHelper; -import org.eclipse.jst.j2ee.internal.IEJBModelExtenderProvider; -import org.eclipse.wst.common.frameworks.internal.enablement.Identifiable; -import org.eclipse.wst.common.frameworks.internal.enablement.IdentifiableComparator; - -/** - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class EclipseEJBModelExtenderProvider extends RegistryReader implements IEJBModelExtenderProvider { - - private SortedSet extensionHelpers; - - /* - * static final String EXTENSION_NAME = "e"; //$NON-NLS-1$ static final - * String ELEMENT_J2EEMODULE_EXTENSION = "j2eeModuleExtensionHelper"; - * //$NON-NLS-1$ static final String MODULE_EXTENSION_CLASS = - * "extensionClass"; //$NON-NLS-1$ - */ - - private static EclipseEJBModelExtenderProvider INSTANCE = null; - - public static class Descriptor implements Identifiable { - - public static final String EJB_MODEL_EXTENDER = "ejbModelExtender"; //$NON-NLS-1$ - - public static final String ATT_ID = "id"; //$NON-NLS-1$ - - public static final String ATT_EJB_EXTENSION_CLASS = "extensionClass"; //$NON-NLS-1$ - - private static int loadOrderCounter = 0; - - private final String id; - - private final int loadOrder; - - private IConfigurationElement element; - - private EjbModuleExtensionHelper instance; - - public Descriptor(IConfigurationElement element) { - Assert.isLegal(EJB_MODEL_EXTENDER.equals(element.getName()), - "Invalid IConfigurationElement used to create EclipseEJBModelExtenderProvider.Descriptor."); //$NON-NLS-1$ - this.element = element; - this.id = this.element.getAttribute(ATT_ID); - this.loadOrder = loadOrderCounter++; - } - - public String getID() { - return this.id; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.common.frameworks.internal.enablement.Identifiable#getLoadOrder() - */ - public int getLoadOrder() { - return loadOrder; - } - - public EjbModuleExtensionHelper getInstance() { - try { - if (instance == null) - instance = (EjbModuleExtensionHelper) element - .createExecutableExtension(ATT_EJB_EXTENSION_CLASS); - } catch (CoreException e) { - Logger.getLogger().logError(e); - } - return instance; - } - } - - protected EclipseEJBModelExtenderProvider() { - super(J2EECorePlugin.PLUGIN_ID, Descriptor.EJB_MODEL_EXTENDER); - } - - public static EclipseEJBModelExtenderProvider getInstance() { - if (INSTANCE == null) { - INSTANCE = new EclipseEJBModelExtenderProvider(); - INSTANCE.readRegistry(); - } - return INSTANCE; - } - - /** - * readElement() - parse and deal w/ an extension like: <earModuleExtension - * extensionClass = "com.ibm.etools.web.plugin.WebModuleExtensionImpl"/> - */ - public boolean readElement(IConfigurationElement element) { - if (!element.getName().equals(Descriptor.EJB_MODEL_EXTENDER)) return false; - - addModuleExtension(new Descriptor(element)); - return true; - } - - /** - * @param descriptor - */ - private void addModuleExtension(Descriptor descriptor) { - getExtensionHelpers().add(descriptor); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.core.moduleextension.helper.IEJBModelExtenderProvider#getEJBModuleExtension(java.lang.Object) - */ - public EjbModuleExtensionHelper getEJBModuleExtension(Object context) { - //IProject project = null; // TODO MDE Get the project using Project Utilities (add depend to emf.workbench ?) - if (getExtensionHelpers().isEmpty()) - return null; - Descriptor descriptor = (Descriptor) getExtensionHelpers().first(); - if(descriptor != null) - return descriptor.getInstance(); - return null; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jst.j2ee.internal.core.moduleextension.helper.IEJBModelExtenderProvider#hasEJBModuleExtension(java.lang.Object) - */ - public boolean hasEJBModuleExtension(Object context) { - return false; - } - - /** - * @return Returns the extensionHelpers. - */ - protected SortedSet getExtensionHelpers() { - if (extensionHelpers == null) extensionHelpers = new TreeSet(IdentifiableComparator.getInstance()); - return extensionHelpers; - } -} diff --git a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/J2EECorePlugin.java b/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/J2EECorePlugin.java deleted file mode 100644 index f4b97d470..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/J2EECorePlugin.java +++ /dev/null @@ -1,95 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.core.internal.plugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.core.runtime.Status; -import org.eclipse.jem.util.logger.proxy.Logger; -import org.eclipse.jem.util.logger.proxyrender.DefaultPluginTraceRenderer; -import org.eclipse.jst.j2ee.internal.IEJBModelExtenderManager; -import org.eclipse.jst.j2ee.internal.xml.J2EEXmlDtDEntityResolver; -import org.eclipse.wst.common.internal.emf.utilities.DOMUtilities; -import org.osgi.framework.BundleContext; - -/* - * Created on Nov 25, 2003 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -/** - * @author vijayb - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -public class J2EECorePlugin extends Plugin { - public static final String PLUGIN_ID = "org.eclipse.jst.j2ee.core"; //$NON-NLS-1$ - private static J2EECorePlugin inst = null; - protected static Logger logger = null; - /** - * @param descriptor - */ - public J2EECorePlugin() { - super(); - if (inst==null) inst = this; - } - - public void start(BundleContext context) throws Exception { - super.start(context); - IEJBModelExtenderManager.INSTANCE.setProvider(EclipseEJBModelExtenderProvider.getInstance()); - // No that we can register against OSGI dependencies - lets re-use the catalog resolver - J2EEXmlDtDEntityResolver.INSTANCE = new CatalogJ2EEXmlDtDEntityResolver(); - DOMUtilities.setDefaultEntityResolver(J2EEXmlDtDEntityResolver.INSTANCE); - } - - public static J2EECorePlugin getPlugin(){ - return inst; - } - - public static String getPluginID() { - return PLUGIN_ID; - } - - public Logger getMsgLogger() { - if (logger == null) { - logger = Logger.getLogger(getPluginID()); - setRenderer(logger); - } - return logger; - } - - /** - * @param aLogger - */ - protected void setRenderer(Logger aLogger) { - new DefaultPluginTraceRenderer(aLogger); - } - - public static IStatus createStatus(int severity, String message, Throwable exception) { - return new Status(severity, PLUGIN_ID, message, exception); - } - - public static IStatus createStatus(int severity, String message) { - return createStatus(severity, message, null); - } - - public static void logError(Throwable exception) { - Platform.getLog(Platform.getBundle(PLUGIN_ID)).log( createStatus(IStatus.ERROR, exception.getMessage(), exception)); - } - - public static void logError(CoreException exception) { - Platform.getLog(Platform.getBundle(PLUGIN_ID)).log( exception.getStatus() ); - } - -} diff --git a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/erefvalidation.properties b/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/erefvalidation.properties deleted file mode 100644 index 134e11668..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/erefvalidation.properties +++ /dev/null @@ -1,78 +0,0 @@ -############################################################################### -# Copyright (c) 2001, 2006 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -#This properties file hold all the externalised strings for eTools J2EE Validation project -# Validation project -# -# Messages should be according to the format at: -# http://hany.austin.ibm.com/messages/index.html -# -# Briefly: -# MESSAGE_ID=<ComponentPrefix><MessageNumber><TypeCode>: <MessageText> -# -# The prefix for this component is: -# CHKJ (IBM WebSphere Validation) -# -# Note the ": " that appears between the type code and the message text. -# -# :Begin: WebSphere Quality Validation Information :Begin: -#COMPONENTPREFIX CHKJ -#COMPONENTNAMEFOR CHKJ IBM WebSphere Validation -#CMVCPATHNAME ncf/src/java/com/ibm/websphere/validation/erefvalidation.properties -# :End: WebSphere Quality Validation Information :End: -# -# 14-October-2001: -# - -# -------------------------------- -ERROR_EAR_MISSING_EREFNAME=CHKJ3009E: In module {1}, ''ejb-ref-name'' element in ejb-ref: {0} is invalid. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -ERROR_EAR_INVALID_EREFTYPE=CHKJ3010E: In module {1}, ''ejb-ref-type'' element in ejb-ref: {0} is invalid. -#EXPLANATION None. -#USERACTION None. - -ERROR_EAR_MISSING_EREFTYPE=CHKJ3014E: In module {1}, ''ejb-ref-type'' element in ejb-ref: {0} is missing. - - -# -------------------------------- -ERROR_EAR_MISSING_EREFHOME=CHKJ3011E: In module {1}, Home interface is missing from ejb-ref: {0} element. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -ERROR_EAR_MISSING_EREFREMOTE=CHKJ3012E: In module {1}, Remote interface is missing from ejb-ref: {0} element. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -ERROR_EAR_MISSING_EJB_ROLE=CHKJ2827W: ''security-role-ref'' element {0} defines the ''role-link'' element but no ''security-role'' elements in the application descriptor. -#EXPLANATION None. -#USERACTION None. - -# -------------------------------- -ERROR_EAR_DUPLICATE_RESREF=CHKJ3013E: Duplicate ''resource-ref'' element named {0}. -#EXPLANATION None. -#USERACTION None. - -# new string added for version 5 WSAD -UNRESOLVED_EJB_REF_WARN_=IWAE0034W EJB link element {0} is unresolvable in module {1} and EAR {2}. - -ERROR_EAR_DUPLICATE_SERVICEREF=CHKJ3015E: Duplicate ''service-ref'' element named {0}. -ERROR_EAR_DUPLICATE_SECURITYROLEREF=CHKJ3016E: Duplicate ''security role-ref'' element named {0}. -ERROR_EAR_DUPLICATE_EJBREF=CHKJ3017E: Duplicate ''ejb-ref'' element named {0}. -ERROR_EAR_DUPLICATE_RESENVREF=CHKJ3018E: Duplicate ''resource environment-ref'' element named {0}. -ERROR_EAR_DUPLICATE_MESSSAGEDESTINATIONREF=CHKJ3019E: Duplicate ''message destination-ref'' element named {0}. -ERROR_EAR_MISSING_MESSSAGEDESTINATION=Message destination link ''{0}'' for message destination ref ''{1}'' is unresolvable in module ''{2}'' and EAR ''{3}''. -ERROR_UNRESOLVED_MDB_MISSING_MESSAGE_DESTINATION=Message destination link ''{0}'' of MDB ''{1}'' is unresolvable in module ''{2}'' and EAR ''{3}''. -ERROR_EAR_MISSING_EMPTY_MESSSAGEDESTINATION=Message destination link is empty for message destination ref ''{0}'' in module ''{1}'' and EAR ''{2}''. -ERROR_MODULE_DD_FILE_NOT_FOUND=The deployment descriptor of the module ''{0}'' cannot be loaded or found. |