01: /**********************************************************************
02: Copyright (c) 2008 Andy Jefferson and others. All rights reserved.
03: Licensed under the Apache License, Version 2.0 (the "License");
04: you may not use this file except in compliance with the License.
05: You may obtain a copy of the License at
06:
07: http://www.apache.org/licenses/LICENSE-2.0
08:
09: Unless required by applicable law or agreed to in writing, software
10: distributed under the License is distributed on an "AS IS" BASIS,
11: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: See the License for the specific language governing permissions and
13: limitations under the License.
14:
15: Contributors:
16: ...
17: **********************************************************************/package org.jpox;
18:
19: /**
20: * Listener for the relation between a ManagedConnection and a resource using that ManagedConnection.
21: * The resource often needs to know when the ManagedConnection is going to be closed. Similarly the
22: * ManagedConnection may need to know when the resource is being closed (so it can free up resources).
23: *
24: * @version $Revision$
25: */
26: public interface ManagedConnectionResourceListener {
27: /**
28: * On flush. it can be invoked multiple times during the lifecycle of the {@link ManagedConnection}
29: */
30: void managedConnectionFlushed();
31:
32: /**
33: * Method invoked when the managed connection is about to be closed.
34: * Allows the resource to finish its use of the managed connection.
35: */
36: void managedConnectionPreClose();
37:
38: /**
39: * Method invoked when the managed connection has just been closed.
40: */
41: void managedConnectionPostClose();
42:
43: /**
44: * Method invoked when the resource has been closed.
45: * Allows deregistering of this listener from the managed connection.
46: */
47: void resourcePostClose();
48: }
|