Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
FileManager |
|
| 1.0;1 | ||||
FileManager$FileTransactionContext |
|
| 1.0;1 |
1 | /* | |
2 | * $Id: FileManager.java 7963 2007-08-21 08:53:15Z dirk.olmes $ | |
3 | * -------------------------------------------------------------------------------------- | |
4 | * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com | |
5 | * | |
6 | * The software in this package is published under the terms of the CPAL v1.0 | |
7 | * license, a copy of which has been included with this distribution in the | |
8 | * LICENSE.txt file. | |
9 | */ | |
10 | ||
11 | package org.mule.util.file; | |
12 | ||
13 | import org.mule.util.xa.AbstractTransactionContext; | |
14 | import org.mule.util.xa.AbstractXAResourceManager; | |
15 | import org.mule.util.xa.ResourceManagerException; | |
16 | ||
17 | import javax.transaction.xa.XAResource; | |
18 | ||
19 | import org.apache.commons.logging.Log; | |
20 | import org.apache.commons.logging.LogFactory; | |
21 | ||
22 | 0 | public class FileManager extends AbstractXAResourceManager |
23 | { | |
24 | ||
25 | 0 | private static Log logger = LogFactory.getLog(FileManager.class); |
26 | ||
27 | public synchronized FileSession createSession() | |
28 | { | |
29 | 0 | return new TransactedFileSession(this); |
30 | } | |
31 | ||
32 | /* | |
33 | * (non-Javadoc) | |
34 | * | |
35 | * @see org.mule.transaction.xa.AbstractResourceManager#getLogger() | |
36 | */ | |
37 | protected Log getLogger() | |
38 | { | |
39 | 0 | return logger; |
40 | } | |
41 | ||
42 | /* | |
43 | * (non-Javadoc) | |
44 | * | |
45 | * @see org.mule.transaction.xa.AbstractResourceManager#createTransactionContext(java.lang.Object) | |
46 | */ | |
47 | protected AbstractTransactionContext createTransactionContext(Object session) | |
48 | { | |
49 | 0 | return new FileTransactionContext(); |
50 | } | |
51 | ||
52 | /* | |
53 | * (non-Javadoc) | |
54 | * | |
55 | * @see org.mule.transaction.xa.AbstractResourceManager#doBegin(org.mule.transaction.xa.AbstractTransactionContext) | |
56 | */ | |
57 | protected void doBegin(AbstractTransactionContext context) | |
58 | { | |
59 | // template method | |
60 | 0 | } |
61 | ||
62 | /* | |
63 | * (non-Javadoc) | |
64 | * | |
65 | * @see org.mule.transaction.xa.AbstractResourceManager#doPrepare(org.mule.transaction.xa.AbstractTransactionContext) | |
66 | */ | |
67 | protected int doPrepare(AbstractTransactionContext context) | |
68 | { | |
69 | 0 | return XAResource.XA_OK; |
70 | } | |
71 | ||
72 | /* | |
73 | * (non-Javadoc) | |
74 | * | |
75 | * @see org.mule.transaction.xa.AbstractResourceManager#doCommit(org.mule.transaction.xa.AbstractTransactionContext) | |
76 | */ | |
77 | protected void doCommit(AbstractTransactionContext context) throws ResourceManagerException | |
78 | { | |
79 | // template method | |
80 | 0 | } |
81 | ||
82 | /* | |
83 | * (non-Javadoc) | |
84 | * | |
85 | * @see org.mule.transaction.xa.AbstractResourceManager#doRollback(org.mule.transaction.xa.AbstractTransactionContext) | |
86 | */ | |
87 | protected void doRollback(AbstractTransactionContext context) throws ResourceManagerException | |
88 | { | |
89 | // template method | |
90 | 0 | } |
91 | ||
92 | 0 | protected class FileTransactionContext extends AbstractTransactionContext |
93 | { | |
94 | // nothing here yet | |
95 | } | |
96 | ||
97 | } |