Skip to main content
summaryrefslogtreecommitdiffstats
blob: 60720d44876a75f358a7548dba4246a2618bd3dc (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
/*******************************************************************************
 * Copyright (c) 2000, 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.ws.internal.ext;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.wst.common.environment.EnvironmentService;
import org.eclipse.wst.common.environment.ILog;





/**
* This represents an extension in the plugin registry 
* It job is to act as a proxy to the iconfigelement
*/
public class WebServiceExtensionImpl implements WebServiceExtension
{

	private ILog	log_;
	
  /*
  * The ConfigElement that holds extension info
  */
  protected IConfigurationElement configElement_;

  /*
  * The extension executable 
  */
  protected WebServiceExecutable webServiceExecutable_;
  

  public WebServiceExtensionImpl(IConfigurationElement configElement)
  {
    configElement_ = configElement;
    log_ = EnvironmentService.getEclipseLog();
  }

  // Copyright
  public static final String copyright = "(c) Copyright IBM Corporation 2000, 2002.";

  /**
  * If the extension has code that needs to be executed or a fragment added
  * @return WebServiceExecutable this interface holds executable code and a 
  * fragment
  */
  public Object getWebServiceExecutableExtension()
  {
    if(webServiceExecutable_ != null) return webServiceExecutable_;

    try{
      return configElement_.createExecutableExtension("class");
    }catch (CoreException e){
      log_.log(ILog.ERROR, 5029, this, "getWebServiceExecutableExtension",e);
    }

    return null;
  }

  /**
  * This is the config element that holds the extension info
  * @param IConfigurationElement Extension element
  */
  public void setConfigElement(IConfigurationElement configElement)
  {
    configElement_ = configElement;
  }	

  /**
  * This is the config element that holds the extension info
  * @return IConfigurationElement Extension element
  */
  public IConfigurationElement getConfigElement()
  {
    return configElement_;
  }
  
  /**
  * The name of the extension being used
  * @return String name of this extension
  */
  public String getName()
  {
    return getConfigElement().getAttribute( "name" );
  }


}


Back to the top