-
Notifications
You must be signed in to change notification settings - Fork 138
/
ResourceContainerContext.java
179 lines (153 loc) · 5.67 KB
/
ResourceContainerContext.java
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/*
* Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package com.sun.enterprise.deployment.annotation.context;
import com.sun.enterprise.deployment.EjbReferenceDescriptor;
import com.sun.enterprise.deployment.EntityManagerFactoryReferenceDescriptor;
import com.sun.enterprise.deployment.EntityManagerReferenceDescriptor;
import com.sun.enterprise.deployment.EnvironmentProperty;
import com.sun.enterprise.deployment.LifecycleCallbackDescriptor;
import com.sun.enterprise.deployment.ManagedBeanDescriptor;
import com.sun.enterprise.deployment.MessageDestinationReferenceDescriptor;
import com.sun.enterprise.deployment.ResourceDescriptor;
import com.sun.enterprise.deployment.ResourceEnvReferenceDescriptor;
import com.sun.enterprise.deployment.ResourceReferenceDescriptor;
import java.util.Set;
import org.glassfish.deployment.common.JavaEEResourceType;
/**
* This interface provides an abstraction for handle resource references.
*
* @author Shing Wai Chan
*/
public interface ResourceContainerContext extends ServiceReferenceContainerContext {
/**
* Add a ejb reference.
*
* @param ejbReference
*/
void addEjbReferenceDescriptor(EjbReferenceDescriptor ejbReference);
/**
* Looks up an ejb reference with the given name.
*
* @param name the name of the ejb-reference
* @return null if it is not found.
*/
EjbReferenceDescriptor getEjbReference(String name);
/**
* Add a resource reference
*
* @param resReference the resource reference
*/
void addResourceReferenceDescriptor(ResourceReferenceDescriptor resReference);
/**
* Looks up an resource reference with the given name.
*
* @param name the name of the resource-reference
* @return null if it is not found.
*/
ResourceReferenceDescriptor getResourceReference(String name);
/**
* Add a message-destination-ref
*
* @param msgDestRef
*/
void addMessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor msgDestRef);
/**
* Looks up a message-destination-ref with the given name.
*
* @param name the name of the message-destination-ref
* @return null if it is not found.
*/
MessageDestinationReferenceDescriptor getMessageDestinationReference(String name);
/**
* Add a resource-env-ref
*
* @param resourceEnvRef the resourceEnvRef
*/
void addResourceEnvReferenceDescriptor(ResourceEnvReferenceDescriptor resourceEnvRef);
/**
* Looks up a resource-env-ref with the given name.
*
* @param name the name of the resource-env-ref
* @return null if it is not found.
*/
ResourceEnvReferenceDescriptor getResourceEnvReference(String name);
/**
* Add an env-entry
*
* @param envEntry the env-entry
*/
void addEnvEntryDescriptor(EnvironmentProperty envEntry);
/**
* Looks up an env-entry with the given name.
*
* @param name the name of the env-entry
* @return null if it is not found.
*/
EnvironmentProperty getEnvEntry(String name);
void addEntityManagerFactoryReferenceDescriptor(EntityManagerFactoryReferenceDescriptor emfRefDesc);
/**
* Looks up an entity manager factory reference with the given name.
*
* @param name the name of the emf reference
* @return null if it is not found.
*/
EntityManagerFactoryReferenceDescriptor getEntityManagerFactoryReference(String name);
void addEntityManagerReferenceDescriptor(EntityManagerReferenceDescriptor emRefDesc);
/**
* Looks up an entity manager reference with the given name.
*
* @param name the name of the emf reference
* @return null if it is not found.
*/
EntityManagerReferenceDescriptor getEntityManagerReference(String name);
/**
* @param postConstructDesc
*/
void addPostConstructDescriptor(LifecycleCallbackDescriptor postConstructDesc);
/**
* Look up an post-construct LifecycleCallbackDescriptor with the given name.
*
* @param className
* @return null if it is not found
*/
LifecycleCallbackDescriptor getPostConstruct(String className);
/**
* @param preDestroyDesc
*/
void addPreDestroyDescriptor(LifecycleCallbackDescriptor preDestroyDesc);
/**
* Look up an pre-destroy LifecycleCallbackDescriptor with the given name.
*
* @param className
* @return {@link LifecycleCallbackDescriptor} or null if not found
*/
LifecycleCallbackDescriptor getPreDestroy(String className);
/**
* Adds the specified descriptor to the receiver.
*
* @param desc ResourceDescriptor to add.
*/
void addResourceDescriptor(ResourceDescriptor desc);
/**
* Get all descriptors based on the type
*
* @param type
* @return writeable {@link Set} of {@link ResourceDescriptor}
*/
Set<ResourceDescriptor> getResourceDescriptors(JavaEEResourceType type);
void addManagedBean(ManagedBeanDescriptor managedBeanDesc);
}