Skip to main content
summaryrefslogtreecommitdiffstats
blob: c6cf7c66625ac6b291560e69cd92e4b13222c6f7 (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
/*******************************************************************************
 * Copyright (c) 2005, 2006 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
 * -------- -------- -----------------------------------------------------------
 * 20060329   127016 andyzhai@ca.ibm.com - Andy Zhai
 *******************************************************************************/

package org.eclipse.jst.ws.internal.axis.consumption.core.plugin;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.jst.ws.internal.axis.consumption.core.context.AxisEmitterContext;
import org.eclipse.jst.ws.internal.axis.consumption.core.context.PersistentAxisEmitterContext;
import org.eclipse.wst.common.environment.EnvironmentService;
import org.eclipse.wst.common.environment.ILog;
import org.osgi.framework.BundleContext;


/**
* This is the plugin class for the Web Services plugin.
* <p>
* This plugin contains the graphic user interface to the
* Web Services runtime found in org.eclipse.jst.ws.
*/
public class WebServiceAxisConsumptionCorePlugin extends Plugin
{

	/**
	* The identifier of the descriptor of this plugin in plugin.xml.
	*/
	public static final String ID =
		"org.eclipse.jst.ws.axis.consumption.core";

	/**
	* The reference to the singleton instance of this plugin.
	*/
	private static WebServiceAxisConsumptionCorePlugin instance_;
	private ILog log_;

	private PersistentAxisEmitterContext axisEmitterContext_;
	/**
	* Constructs a runtime plugin object for this plugin.
	* The "plugin" element in plugin.xml should include the attribute
	* class = "org.eclipse.jst.ws.axis.consumption.core".
	* @param descriptor The descriptor of this plugin.
	*/
	public WebServiceAxisConsumptionCorePlugin() {
		super();
		if (instance_ == null) {
			instance_ = this;
		}
		log_ = EnvironmentService.getEclipseLog();

	}

  // This method is needed to keep the logging from blowing up.
  public String toString()
  {
    return ID;  
  }
  
	/**
	* Returns the singleton instance of this plugin. Equivalent to calling
	* (WebServiceWasConsumptionPlugin)Platform.getPlugin("org.eclipse.jst.ws.was.v5.tp");
	* @return The WebServiceAxisConsumptionCorePlugin singleton.
	*/
	static public WebServiceAxisConsumptionCorePlugin getInstance() {
		return instance_;
	}
	
	public AxisEmitterContext getAxisEmitterContext()
	{
		if (axisEmitterContext_ == null) 
	  		axisEmitterContext_ = PersistentAxisEmitterContext.getInstance();
		return axisEmitterContext_;
	}

	/**
	* Called once by the platform when this plugin is first loaded.
	* @throws CoreException If this plugin fails to start.
	*/
	public void start( BundleContext bundle ) throws CoreException {
		log_.log(ILog.INFO, 5087, this, "start", "Starting plugin org.eclipse.jst.ws.axis.consumption.core");
    
    try
    {
		  super.start( bundle );
    }
    catch( Exception exc )
    {
      log_.log( ILog.ERROR, 5088, this, "start", exc );
    }
	}

	/**
	* Called once by the platform when this plugin is unloaded.
	* @throws CoreException If this plugin fails to shutdown.
	*/
	public void stop( BundleContext context ) throws CoreException {
		log_.log(ILog.INFO, 5089, this, "shutdown", "Shutting plugin org.eclipse.jst.ws.axis.consumption.core");
    
    try
    {
		  super.stop( context );
    }
    catch( Exception exc )
    {
      log_.log( ILog.ERROR, 5090, this, "stop", exc );      
    }
	}
}

Back to the top