1 package fr.in2p3.jsaga.impl.session;
2
3 import fr.in2p3.jsaga.engine.session.SessionConfiguration;
4 import org.ogf.saga.error.*;
5 import org.ogf.saga.session.Session;
6 import org.ogf.saga.session.SessionFactory;
7
8
9
10
11
12
13
14
15
16
17
18
19
20 public class SessionFactoryImpl extends SessionFactory {
21 private SessionConfiguration m_config;
22
23 public SessionFactoryImpl(SessionConfiguration config) {
24 m_config = config;
25 }
26
27 protected Session doCreateSession(boolean defaults) throws NoSuccessException {
28 Session session = new SessionImpl();
29 if (defaults) {
30 try {
31 m_config.setDefaultSession(session);
32 }
33 catch (NoSuccessException e) {throw e;}
34 catch (SagaException e) {throw new NoSuccessException(e);}
35 }
36 return session;
37 }
38 }