01: /**
02: * Sequoia: Database clustering technology.
03: * Copyright (C) 2002-2004 French National Institute For Research In Computer
04: * Science And Control (INRIA).
05: * Copyright (C) 2005 AmicoSoft, Inc. dba Emic Networks
06: * Copyright (C) 2005-2006 Continuent, Inc.
07: * Contact: sequoia@continuent.org
08: *
09: * Licensed under the Apache License, Version 2.0 (the "License");
10: * you may not use this file except in compliance with the License.
11: * You may obtain a copy of the License at
12: *
13: * http://www.apache.org/licenses/LICENSE-2.0
14: *
15: * Unless required by applicable law or agreed to in writing, software
16: * distributed under the License is distributed on an "AS IS" BASIS,
17: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18: * See the License for the specific language governing permissions and
19: * limitations under the License.
20: *
21: * Initial developer(s): Emmanuel Cecchet.
22: * Contributor(s): ______________________.
23: */package org.continuent.sequoia.controller.virtualdatabase.protocol;
24:
25: import java.io.Serializable;
26:
27: import org.continuent.hedera.common.Member;
28: import org.continuent.sequoia.common.jmx.management.BackendInfo;
29: import org.continuent.sequoia.controller.backend.DatabaseBackend;
30: import org.continuent.sequoia.controller.virtualdatabase.DistributedVirtualDatabase;
31:
32: /**
33: * Send the information that the sender wants to disable the specified backend.
34: *
35: * @author <a href="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet </a>
36: * @version 1.0
37: */
38: public class NotifyDisableBackend extends
39: DistributedVirtualDatabaseMessage {
40: private static final long serialVersionUID = 430250030369313030L;
41:
42: private BackendInfo backendInfo;
43:
44: /**
45: * Creates a new DisableBackend object with the specified backend information.
46: *
47: * @param backendInfo information on the backend to disable
48: */
49: public NotifyDisableBackend(BackendInfo backendInfo) {
50: this .backendInfo = backendInfo;
51: }
52:
53: /**
54: * Get the backend that needs to be disabled.
55: *
56: * @return the backend to disable.
57: */
58: public DatabaseBackend getDatabaseBackend() {
59: return backendInfo.getDatabaseBackend();
60: }
61:
62: /**
63: * @see org.continuent.sequoia.controller.virtualdatabase.protocol.DistributedVirtualDatabaseMessage#handleMessageSingleThreaded(org.continuent.sequoia.controller.virtualdatabase.DistributedVirtualDatabase,
64: * org.continuent.hedera.common.Member)
65: */
66: public Object handleMessageSingleThreaded(
67: DistributedVirtualDatabase dvdb, Member sender) {
68: return null;
69: }
70:
71: /**
72: * @see org.continuent.sequoia.controller.virtualdatabase.protocol.DistributedVirtualDatabaseMessage#handleMessageMultiThreaded(org.continuent.sequoia.controller.virtualdatabase.DistributedVirtualDatabase,
73: * org.continuent.hedera.common.Member, java.lang.Object)
74: */
75: public Serializable handleMessageMultiThreaded(
76: DistributedVirtualDatabase dvdb, Member sender,
77: Object handleMessageSingleThreadedResult) {
78: dvdb.handleRemoteDisableBackendNotification(
79: getDatabaseBackend(), sender);
80: return null;
81: }
82:
83: }
|