Skip to main content
aboutsummaryrefslogblamecommitdiffstats
blob: 7f27d529b62f0f820eaf2adac354e2d972522246 (plain) (tree)
1
2
3
4
5
6
7
8
9







                                                                        
   








                                                         
 
                                               

 
            
           





                                                
 









                                                
 













                                             
 
            

                                       




                                                
                  



                                                                
                  



                                               
                  




                                                 
package org.eclipse.papyrus.infra.core.serviceregistry;

import org.eclipse.papyrus.infra.core.serviceregistry.IService;
import org.eclipse.papyrus.infra.core.serviceregistry.ServicesRegistry;


/**
 * Fake service for testing purpose.
 *
 * @author cedric dumoulin
 *
 */
public class FakeService implements IService {


	static public TestTrace trace = new TestTrace();

	static int count = 0;

	public String name = "name" + count++;


	/**
	 *
	 * Constructor.
	 *
	 */
	public FakeService() {
		trace.addTrace(name, "create");
	}

	/**
	 * Constructor.
	 *
	 * @param name
	 */
	public FakeService(String name) {
		this.name = name;
		trace.addTrace(name, "create");
	}


	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @return the trace
	 */
	static public TestTrace getTrace() {
		return trace;
	}


	/**
	 * @param trace
	 *            the trace to set
	 */
	public void setTrace(TestTrace trace) {
		FakeService.trace = trace;
	}

	@Override
	public void init(ServicesRegistry servicesRegistry) {
		trace.addTrace(name, "init", servicesRegistry);
	}

	@Override
	public void startService() {
		trace.addTrace(name, "start");
	}

	@Override
	public void disposeService() {
		trace.addTrace(name, "dispose");
	}

}

Back to the top