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) 2009, 2010 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
* yyyymmdd bug Email and other contact information
* -------- -------- -----------------------------------------------------------
* 20091021 291954 ericdp@ca.ibm.com - Eric D. Peters, JAX-RS: Implement JAX-RS Facet
* 20100303 291954 kchong@ca.ibm.com - Keith Chong, JAX-RS: Implement JAX-RS Facet
*******************************************************************************/
package org.eclipse.jst.ws.jaxrs.core.internal.jaxrssharedlibraryconfig;
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.core.runtime.IProgressMonitor;
public class SharedLibraryConfiguratorImpl implements SharedLibraryConfigurator {
private IConfigurationElement config_element;
/**
* Key of the 'jaxrsSharedLibraryConfiguratorDelegate' attribute of the extension point.
*/
public final static String DELEGATE = "jaxrsSharedLibraryConfiguratorDelegate"; //$NON-NLS-1$
boolean selected = false;
String name;
String runtimeID;
public SharedLibraryConfiguratorImpl(IConfigurationElement config_element) {
this.config_element = config_element;
}
public boolean getIsSharedLibSupported(IProject webProject, IProject earProject, boolean addToEAR, String JAXRSLibraryID) {
JAXRSSharedLibConfiguratorDelegate sharedLibConfigurator = null;
try {
sharedLibConfigurator = (JAXRSSharedLibConfiguratorDelegate) config_element
.createExecutableExtension(DELEGATE);
} catch (CoreException e) {
//not much we want to do here, just return not suported
}
if (sharedLibConfigurator != null) {
return sharedLibConfigurator.sharedLibSupported(webProject, earProject, addToEAR, JAXRSLibraryID);
}
return false;
}
public String getName() {
return name;
}
public String getRuntimeID() {
return runtimeID;
}
public void installSharedLibs(IProject webProject, IProject earProject, IProgressMonitor monitor, String JAXRSLibraryID) throws CoreException {
JAXRSSharedLibConfiguratorDelegate sharedLibConfigurator = null;
sharedLibConfigurator = (JAXRSSharedLibConfiguratorDelegate) config_element
.createExecutableExtension(DELEGATE);
if (sharedLibConfigurator != null) {
sharedLibConfigurator.installSharedLibs(webProject, earProject, monitor, JAXRSLibraryID);
}
}
public void setName(String value) {
this.name = value;
}
public void unInstallSharedLibs(IProject webProject) {
JAXRSSharedLibConfiguratorDelegate sharedLibConfigurator = null;
try {
sharedLibConfigurator = (JAXRSSharedLibConfiguratorDelegate) config_element
.createExecutableExtension(DELEGATE);
} catch (CoreException e) {
//not much we want to do, libraries not uninstalled
}
if (sharedLibConfigurator != null) {
sharedLibConfigurator.unInstallSharedLibs(webProject);
}
}
public void setRuntimeID(String value) {
this.runtimeID = value;
}
public boolean getSelected() {
return this.selected;
}
public void setSelected(boolean value) {
this.selected = value;
}
public void installSharedLibs(IProject webProject, IProject earProject,
IProgressMonitor monitor, List<String> libraryNames)
throws CoreException {
JAXRSSharedLibConfiguratorDelegate sharedLibConfigurator = null;
sharedLibConfigurator = (JAXRSSharedLibConfiguratorDelegate) config_element
.createExecutableExtension(DELEGATE);
if (sharedLibConfigurator != null) {
sharedLibConfigurator.installSharedLibs(webProject, earProject, monitor, libraryNames);
}
}
}
|