Skip to main content
summaryrefslogtreecommitdiffstats
blob: b3a0046c4a6fd43f1332b4a91eacf739c3b83f7e (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
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
/*******************************************************************************
 * 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.commonarchivecore.internal;



import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Set;

import org.eclipse.emf.ecore.EFactory;
import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException;
import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveOptions;
import org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy;
import org.eclipse.jst.j2ee.commonarchivecore.looseconfig.internal.LooseArchive;


/**
 * @generated
 */
public interface CommonarchiveFactory extends EFactory{

	/**
	 * The singleton instance of the factory.
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * @generated
	 */
	CommonarchiveFactory eINSTANCE = new org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl();

	/**
	 * Tell the factory that an archive has been opened; the factory maintains a weak set of all the
	 * open archives to determine if another archive can be closed.
	 */
	public void archiveClosed(Archive aClosedArchive);

	/**
	 * Tell the factory that an archive has been opened; the factory maintains a weak set of all the
	 * open archives to determine if another archive can be closed.
	 */
	public void archiveOpened(Archive anOpenArchive);

	/**
	 * @deprecated Use {@link #getOpenArchivesDependingOn(Archive)}
	 * 
	 * If any opened archive contains files that have the parameter as its loading container, return
	 * false; otherwise return true. This method supports the following scenario: open jar A. create
	 * jar B. Copy files from A to B. Attempt to close jar A before saving jar B. Then attempt to
	 * save B, and the save fails because A is closed. This method allows client code to test for
	 * dependent open archives before saving the source archive. If this method returns false, the
	 * solution is to either close or save B before closing A.
	 */
	public boolean canClose(Archive anArchive);

	/**
	 * Close any open archives and delete the temp files associated with nested archives. Due to
	 * limitations in the deleteOnExit() method of file, in 1.2.2 there is no way to ensure these
	 * files get deleted. Client code should use good practice by calling {@link Archive#close}when
	 * finished with an Archive instance, rather than just discard an instance with open file
	 * handles and wait for it to be gc'd. Beyond that, program code compiled for 1.3 can (and
	 * should) implement the following shutdown hook: <code>
	 * 	Runtime.getRuntime().addShutdownHook(new Thread() {
	 public void run() {
	 ((CommonarchivePackage)EPackage.Registry.INSTANCE.getEPackage(CommonarchivePackage.eNS_URI)).getCommonarchiveFactory().closeOpenArchives();
	 }
	 });</code>
	 */
	public void closeOpenArchives();

	public Archive copy(Archive anArchive);

	public ModuleFile copy(ModuleFile aModuleFile);

	/**
	 * Creates a new archive for editing, and initializes it appropriately (adds an empty deployment
	 * descriptor)
	 */
	public ApplicationClientFile createApplicationClientFileInitialized(String uri);

	/**
	 * Creates a new archive for editing, and initializes it appropriately
	 */
	public Archive createArchiveInitialized(String uri);

	/**
	 * Used internally; clients usually should not need this method
	 */
	public LoadStrategy createChildLoadStrategy(String uri, LoadStrategy parent) throws java.io.IOException, java.io.FileNotFoundException;

	/**
	 * Creates a new archive for editing, and initializes it appropriately (adds an empty deployment
	 * descriptor)
	 */
	public EARFile createEARFileInitialized(String uri);

	/**
	 * Creates a new archive for editing, and initializes it appropriately (adds an empty deployment
	 * descriptor)
	 */
	public EJBJarFile createEJBJarFileInitialized(String uri);

	/**
	 * Create an initialized archive based on the given URI and options
	 */
	public Archive createArchiveInitialized(ArchiveOptions options, java.lang.String uri);

	/**
	 * Create an initialized EAR based on the given URI and options
	 */
	public EARFile createEARFileInitialized(ArchiveOptions options, java.lang.String uri);

	/**
	 * Create an initialized EJB based on the given URI and options
	 */
	public EJBJarFile createEJBJarFileInitialized(ArchiveOptions options, java.lang.String uri);

	/**
	 * Initialize archive based on the options
	 */
	public void initializeNewApplicationClientFile(ApplicationClientFile anArchive, String uri, ArchiveOptions options);

	/**
	 * Initialize archive based on the options
	 */
	public void initializeNewArchive(Archive anArchive, String uri, ArchiveOptions options);

	/**
	 * Initialize archive based on the options
	 */
	public void initializeNewEARFile(EARFile anArchive, String uri, ArchiveOptions options);

	/**
	 * Initialized archive based on the options
	 */
	public void initializeNewEJBJarFile(EJBJarFile anArchive, String uri, ArchiveOptions options);

	/**
	 * Initialized archive based on the options
	 */
	public void initializeNewModuleFile(ModuleFile anArchive, String uri, ArchiveOptions options);

	/**
	 * Initialized archive based on the options
	 */
	public void initializeNewRARFile(RARFile anArchive, String uri, ArchiveOptions options);

	/**
	 * Initialized archive based on the options
	 */
	public void initializeNewWARFile(WARFile anArchive, String uri, ArchiveOptions options);

	/**
	 * Returns a NullLoadStrategyImpl; used for new archives
	 */
	LoadStrategy createEmptyLoadStrategy();

	/**
	 * Helper method to dynamically build a load strategy from the file system. Determines whether
	 * the uri points to a jar file or directory and returns the appropriate strategy
	 */
	public LoadStrategy createLoadStrategy(String uri) throws FileNotFoundException, IOException;

	/**
	 * @see com.ibm.etools.commonarchive.CommonarchiveFactory
	 */
	public RARFile createRARFileInitialized(java.lang.String uri);

	/**
	 * Creates a new archive for editing, and initializes it appropriately (adds an empty deployment
	 * descriptor)
	 */
	public WARFile createWARFileInitialized(String uri);

	/**
	 * Helper method to introspect an archive and get it's class path entries before fully opening
	 * the archive; needed because we may need extra classpath info to be able to open the 1.0 file
	 * and deserialize its deployment descriptor
	 * 
	 * @return a tokenized array of class path components
	 */
	public String[] getManifestClassPathValues(String uri) throws OpenFailureException;

	/**
	 * Return a list of all root level (non-nested) opened archives containing files that have the
	 * parameter as its loading container; the set will be empty if no such opened archive exists.
	 * This method supports the following scenario: open jar A. create jar B. Copy files from A to
	 * B. Attempt to close jar A before saving jar B. Then attempt to save B, and the save fails
	 * because A is closed. This method allows client code to test for dependent open archives
	 * before saving the source archive. If the return value is not empty, the solution is to either
	 * close or save B before closing A.
	 */
	public Set getOpenArchivesDependingOn(Archive anArchive);

	/**
	 * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
	 * URI still necessary so the archive has a name, but it will not be used for io.
	 */
	public ApplicationClientFile openApplicationClientFile(ArchiveOptions options, String uri) throws OpenFailureException;

	/**
	 * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
	 * URI still necessary so the archive has a name, but it will not be used for io.
	 */
	public ApplicationClientFile openApplicationClientFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException;

	public ApplicationClientFile openApplicationClientFile(String uri) throws OpenFailureException;

	/**
	 * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
	 * URI still necessary so the archive has a name, but it will not be used for io.
	 */
	public Archive openArchive(ArchiveOptions options, String uri) throws OpenFailureException;

	/**
	 * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
	 * URI still necessary so the archive has a name, but it will not be used for io.
	 */
	public Archive openArchive(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException;

	/**
	 * open the archive by the passed uri
	 * 
	 * @return the appropriate kind of archive
	 */
	public Archive openArchive(String uri) throws OpenFailureException;

	/**
	 * open the archive by the passed uri, and use the extraClassPath for java reflection, in
	 * addition to the manifest class-path; mostly used for ejb 1.0 jar files to be converted
	 * 
	 * @return the appropriate kind of archive
	 */
	public Archive openArchive(String uri, String extraClassPath) throws OpenFailureException;

	/**
	 * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
	 * URI still necessary so the archive has a name, but it will not be used for io.
	 */
	public EARFile openEARFile(ArchiveOptions options, String uri) throws OpenFailureException;

	/**
	 * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
	 * URI still necessary so the archive has a name, but it will not be used for io.
	 */
	public EARFile openEARFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException;

	public EARFile openEARFile(String uri) throws OpenFailureException;

	/**
	 * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
	 * URI still necessary so the archive has a name, but it will not be used for io.
	 */
	public EJBJarFile openEJB11JarFile(ArchiveOptions options, String uri) throws OpenFailureException;

	/**
	 * @see com.ibm.etools.commonarchive.CommonarchiveFactory
	 */
	public EJBJarFile openEJB11JarFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException;

	/**
	 * @see com.ibm.etools.commonarchive.CommonarchiveFactory
	 */
	public EJBJarFile openEJB11JarFile(String uri) throws OpenFailureException;

	/**
	 * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
	 * URI still necessary so the archive has a name, but it will not be used for io.
	 */
	public EJBJarFile openEJBJarFile(ArchiveOptions options, String uri) throws OpenFailureException;

	/**
	 * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
	 * URI still necessary so the archive has a name, but it will not be used for io.
	 */
	public EJBJarFile openEJBJarFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException;

	/**
	 * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
	 * URI still necessary so the archive has a name, but it will not be used for io.
	 */
	public EJBJarFile openEJBJarFile(LoadStrategy aLoadStrategy, String uri, String extraClassPath) throws OpenFailureException;

	public EJBJarFile openEJBJarFile(String uri) throws OpenFailureException;

	public EJBJarFile openEJBJarFile(String uri, String extraClassPath) throws OpenFailureException;

	/**
	 * Used internally for openning an Archive in an Archive
	 */
	public Archive openNestedArchive(String uri, Archive parent) throws OpenFailureException;

	/**
	 * Used internally for openning an Archive in an Archive
	 */
	public Archive openNestedArchive(LooseArchive loose, Archive parent) throws OpenFailureException;

	/**
	 * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
	 * URI still necessary so the archive has a name, but it will not be used for io.
	 */
	public RARFile openRARFile(ArchiveOptions options, java.lang.String uri) throws OpenFailureException;

	/**
	 * @see com.ibm.etools.commonarchive.CommonarchiveFactory
	 */
	public RARFile openRARFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException;

	/**
	 * @see com.ibm.etools.commonarchive.CommonarchiveFactory
	 */
	public RARFile openRARFile(String uri) throws OpenFailureException;

	public ReadOnlyDirectory openReadOnlyDirectory(String uri) throws java.io.IOException;

	/**
	 * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
	 * URI still necessary so the archive has a name, but it will not be used for io.
	 */
	public WARFile openWARFile(ArchiveOptions options, String uri) throws OpenFailureException;

	/**
	 * open the archive, setting up the appropriate strategies, using the loadStrategy passed in;
	 * URI still necessary so the archive has a name, but it will not be used for io.
	 */
	public WARFile openWARFile(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException;

	public WARFile openWARFile(String uri) throws OpenFailureException;

	/**
	 * Open the archive by the passed parameter, without attempting to determine what kind of
	 * archive it is
	 * 
	 * @return an instance of Archive, but not a subclass
	 */
	Archive primOpenArchive(String uri) throws OpenFailureException;

	Archive primOpenArchive(LoadStrategy aLoadStrategy, String uri) throws OpenFailureException;

	Archive primOpenArchive(ArchiveOptions options, String uri) throws OpenFailureException;

	/**
	 * @generated This field/method will be replaced during code generation
	 * @return WARFile value
	 */
	WARFile createWARFile();

	/**
	 * @generated This field/method will be replaced during code generation
	 * @return EJBJarFile value
	 */
	EJBJarFile createEJBJarFile();

	/**
	 * @generated This field/method will be replaced during code generation
	 * @return ApplicationClientFile value
	 */
	ApplicationClientFile createApplicationClientFile();

	/**
	 * @generated This field/method will be replaced during code generation
	 * @return EARFile value
	 */
	EARFile createEARFile();

	/**
	 * @generated This field/method will be replaced during code generation
	 * @return RARFile value
	 */
	RARFile createRARFile();

	/**
	 * @generated This field/method will be replaced during code generation
	 * @return Archive value
	 */
	Archive createArchive();

	/**
	 * @generated This field/method will be replaced during code generation
	 * @return File value
	 */
	File createFile();

	/**
	 * @generated This field/method will be replaced during code generation
	 * @return ReadOnlyDirectory value
	 */
	ReadOnlyDirectory createReadOnlyDirectory();

	/**
	 * @generated This field/method will be replaced during code generation.
	 */
	CommonarchivePackage getCommonarchivePackage();

	/**
	 * @generated This field/method will be replaced during code generation
	 * @return EJBModuleRef value
	 */
	EJBModuleRef createEJBModuleRef();

	/**
	 * Convienince method for wrapping a standalone EJB JAR file
	 */
	EJBModuleRef createEJBModuleRef(EJBJarFile ejbJarFile);


	/**
	 * @generated This field/method will be replaced during code generation
	 * @return WebModuleRef value
	 */
	WebModuleRef createWebModuleRef();

	/**
	 * Convienince method for wrapping a standalone WAR file
	 */
	WebModuleRef createWebModuleRef(WARFile warFile);

	/**
	 * @generated This field/method will be replaced during code generation
	 * @return ClientModuleRef value
	 */
	ClientModuleRef createClientModuleRef();

	/**
	 * Convienince method for wrapping a standalone Application Client JAR file
	 */
	ClientModuleRef createClientModuleRef(ApplicationClientFile clientFile);

	/**
	 * @generated This field/method will be replaced during code generation
	 * @return ConnectorModuleRef value
	 */
	ConnectorModuleRef createConnectorModuleRef();

	/**
	 * Convienince method for wrapping a standalone RAR file
	 */
	ConnectorModuleRef createConnectorModuleRef(RARFile rarFile);
}

Back to the top