001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.websvc.jaxws;
043:
044: import java.io.IOException;
045: import java.net.URL;
046: import java.util.HashMap;
047: import java.util.List;
048: import java.util.Map;
049: import org.netbeans.modules.j2ee.dd.api.webservices.WebservicesMetadata;
050: import org.netbeans.modules.j2ee.metadata.model.api.MetadataModel;
051: import org.netbeans.modules.websvc.jaxws.api.JAXWSSupport;
052: import org.netbeans.modules.websvc.jaxws.spi.JAXWSSupportFactory;
053: import org.netbeans.modules.websvc.jaxws.spi.JAXWSSupportImpl;
054: import org.netbeans.modules.websvc.jaxws.spi.JAXWSSupportProvider;
055: import org.netbeans.spi.project.support.ant.AntProjectHelper;
056: import org.openide.filesystems.FileObject;
057:
058: /**
059: *
060: * @author Lukas Jungmann
061: */
062: public class CustomJAXWSSupportProvider implements JAXWSSupportProvider {
063:
064: private Map<FileObject, JAXWSSupport> cache = new HashMap<FileObject, JAXWSSupport>();
065:
066: /** Creates a new instance of TestProjectJAXWSSupportProvider */
067: public CustomJAXWSSupportProvider() {
068: }
069:
070: public JAXWSSupport findJAXWSSupport(FileObject file) {
071: if (file.getExt().equals("ws")) {
072: JAXWSSupport em = cache.get(file.getParent());
073: if (em == null) {
074: em = JAXWSSupportFactory
075: .createJAXWSSupport(new CustomJAXWSSupport(file
076: .getParent()));
077: cache.put(file.getParent(), em);
078: }
079: return em;
080: }
081: return null;
082: }
083:
084: private static class CustomJAXWSSupport implements JAXWSSupportImpl {
085:
086: private FileObject fo;
087:
088: CustomJAXWSSupport(FileObject fo) {
089: this .fo = fo;
090: }
091:
092: public void addService(String serviceName, String serviceImpl,
093: boolean isJsr109) {
094: throw new UnsupportedOperationException(
095: "Not supported yet.");
096: }
097:
098: public String addService(String name, String serviceImpl,
099: String wsdlUrl, String serviceName, String portName,
100: String packageName, boolean isJsr109,
101: boolean useProvider) {
102: throw new UnsupportedOperationException(
103: "Not supported yet.");
104: }
105:
106: public List getServices() {
107: throw new UnsupportedOperationException(
108: "Not supported yet.");
109: }
110:
111: public void removeService(String serviceName) {
112: throw new UnsupportedOperationException(
113: "Not supported yet.");
114: }
115:
116: public void serviceFromJavaRemoved(String serviceName) {
117: throw new UnsupportedOperationException(
118: "Not supported yet.");
119: }
120:
121: public String getServiceImpl(String serviceName) {
122: throw new UnsupportedOperationException(
123: "Not supported yet.");
124: }
125:
126: public boolean isFromWSDL(String serviceName) {
127: throw new UnsupportedOperationException(
128: "Not supported yet.");
129: }
130:
131: public FileObject getWsdlFolder(boolean create)
132: throws IOException {
133: throw new UnsupportedOperationException(
134: "Not supported yet.");
135: }
136:
137: public FileObject getLocalWsdlFolderForService(
138: String serviceName, boolean createFolder) {
139: throw new UnsupportedOperationException(
140: "Not supported yet.");
141: }
142:
143: public FileObject getBindingsFolderForService(
144: String serviceName, boolean createFolder) {
145: throw new UnsupportedOperationException(
146: "Not supported yet.");
147: }
148:
149: public AntProjectHelper getAntProjectHelper() {
150: throw new UnsupportedOperationException(
151: "Not supported yet.");
152: }
153:
154: public URL getCatalog() {
155: throw new UnsupportedOperationException(
156: "Not supported yet.");
157: }
158:
159: public String getWsdlLocation(String serviceName) {
160: throw new UnsupportedOperationException(
161: "Not supported yet.");
162: }
163:
164: public void removeNonJsr109Entries(String serviceName)
165: throws IOException {
166: throw new UnsupportedOperationException(
167: "Not supported yet.");
168: }
169:
170: public FileObject getDeploymentDescriptorFolder() {
171: throw new UnsupportedOperationException(
172: "Not supported yet.");
173: }
174:
175: public MetadataModel<WebservicesMetadata> getWebservicesMetadataModel() {
176: throw new UnsupportedOperationException(
177: "Not supported yet.");
178: }
179: }
180: }
|