Skip to main content
summaryrefslogtreecommitdiffstats
blob: fa6a512647283ca47fa335a79419ec53c705fd9d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*******************************************************************************
 * 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);

}

Back to the top