01: /*
02: * BEGIN_HEADER - DO NOT EDIT
03: *
04: * The contents of this file are subject to the terms
05: * of the Common Development and Distribution License
06: * (the "License"). You may not use this file except
07: * in compliance with the License.
08: *
09: * You can obtain a copy of the license at
10: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
11: * See the License for the specific language governing
12: * permissions and limitations under the License.
13: *
14: * When distributing Covered Code, include this CDDL
15: * HEADER in each file and include the License file at
16: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
17: * If applicable add the following below this CDDL HEADER,
18: * with the fields enclosed by brackets "[]" replaced with
19: * your own identifying information: Portions Copyright
20: * [year] [name of copyright owner]
21: */
22:
23: /*
24: * @(#)Upgrade.java
25: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
26: *
27: * END_HEADER - DO NOT EDIT
28: */
29: package com.sun.jbi.component;
30:
31: import java.util.List;
32: import javax.jbi.JBIException;
33:
34: /**
35: * This is an optional interface that can be implemented by a JBI component to
36: * provide a way to upgrade to a new version of the component. It is called by
37: * the JBI runtime during the upgrade processing initiated by a client, which
38: * can be either an ant task, an asadmin command, or an action in the admin
39: * console.
40: *
41: * @author Mark S White
42: */
43: public interface Upgrade {
44: /**
45: * This method is called by the JBI runtime to allow a component to upgrade
46: * its workspace and any existing Service Units to match the new version of
47: * the component. The JBI runtime copies the existing workspace root to the
48: * new workspace root prior to calling this method, so that the component
49: * can examine the contents of the workspace root to determine the version
50: * of the component from which the upgrade is being made. All updates to the
51: * workspace root and Service Unit roots are done in-place; in the event of
52: * a failure, the JBI runtime reverts back to the original workspace root
53: * and the Service Unit roots.
54: * <p>
55: * Note that the component must ensure that it never holds open references
56: * to any files in the workspace root or any of the Service Unit roots upon
57: * returning from this method. Failure to do so will cause problems when
58: * the runtime attempts to complete the upgrade processing.
59: *
60: * @param workspaceRoot the workspace root for the new version of the
61: * component that will replace the currently installed version. This is
62: * populated with the contents of the original workspace root and the
63: * component must update it to match the new version of the component.
64: * @param serviceUnitRoots a list of directory paths to all of the Service
65: * Units currently deployed to the component. The component must update all
66: * of these to match the new version of the component.
67: * @exception JBIException when there is an error requiring that the upgrade
68: * be terminated.
69: */
70: void upgrade(String workspaceRoot, List<String> serviceUnitRoots)
71: throws JBIException;
72: }
|