1
2
3
4
5
6
7
8
9
10
11 package org.mule.test.integration.config;
12
13 import org.mule.MuleServer;
14 import org.mule.api.lifecycle.InitialisationCallback;
15 import org.mule.api.lifecycle.InitialisationException;
16 import org.mule.api.object.ObjectFactory;
17 import org.mule.api.service.Service;
18 import org.mule.component.simple.EchoComponent;
19 import org.mule.jndi.SimpleContext;
20 import org.mule.module.management.agent.Log4jAgent;
21 import org.mule.module.xml.transformer.XmlToObject;
22 import org.mule.tck.MuleTestUtils;
23 import org.mule.transport.vm.VMConnector;
24
25
26
27
28 public class DummyInitialContextFactory implements ObjectFactory
29 {
30 public Object getInstance() throws Exception
31 {
32 SimpleContext c = new SimpleContext();
33 c.bind("vmConnector", new VMConnector());
34 c.bind("endpointRef", "vm://my.object");
35 c.bind("Log4JAgent", new Log4jAgent());
36 c.bind("XmlToObject", new XmlToObject());
37 Service d = MuleTestUtils.getTestService("EchoUMO", EchoComponent.class, MuleServer.getMuleContext());
38 c.bind("EchoUMO", d);
39 return c;
40 }
41
42 public void initialise() throws InitialisationException
43 {
44
45 }
46
47 public void dispose()
48 {
49
50 }
51
52 public void release(Object arg0)
53 {
54
55 }
56
57 public Class getObjectClass()
58 {
59 throw new UnsupportedOperationException();
60 }
61
62 public void addObjectInitialisationCallback(InitialisationCallback callback)
63 {
64 throw new UnsupportedOperationException();
65 }
66
67 public boolean isSingleton()
68 {
69 return false;
70 }
71 }