aoqi@0: /* aoqi@0: * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. Oracle designates this aoqi@0: * particular file as subject to the "Classpath" exception as provided aoqi@0: * by Oracle in the LICENSE file that accompanied this code. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: */ aoqi@0: aoqi@0: package com.sun.xml.internal.ws.api.ha; aoqi@0: aoqi@0: import com.sun.xml.internal.ws.api.message.Packet; aoqi@0: aoqi@0: /** aoqi@0: * This class has HA information aoqi@0: *

aoqi@0: * aoqi@0: * This would help a loadbalancer to put the request(in case of a fail-over) aoqi@0: * on a replica instance that has all the related data. Even if there is no aoqi@0: * loadbalancer, a backing store could locate the information by directly aoqi@0: * going to the correct replica instance. This would also help any part of aoqi@0: * the runtime to know about failover case(and in-turn may invalidate aoqi@0: * local caches). aoqi@0: * aoqi@0: *

aoqi@0: * To achieve this functionality, it carries two pieces of information: aoqi@0: *

    aoqi@0: *
  1. key - Related {@link com.sun.org.glassfish.ha.store.api.BackingStore} keys can aoqi@0: * use this info for their HashableKey impl. First store creates this object, aoqi@0: * and subsequent related stores use the same key. aoqi@0: *
  2. replicaInstance - where the related info is replicated aoqi@0: *
aoqi@0: * aoqi@0: *

aoqi@0: * This can be accessed from {@link Packet} using {@link Packet#HA_INFO} aoqi@0: * property by the runtime. This object is created typically aoqi@0: *

aoqi@0: * aoqi@0: * @author Jitendra Kotamraju aoqi@0: * @since JAX-WS RI 2.2.2 aoqi@0: */ aoqi@0: public class HaInfo { aoqi@0: private final String replicaInstance; aoqi@0: private final String key; aoqi@0: private final boolean failOver; aoqi@0: aoqi@0: public HaInfo(String key, String replicaInstance, boolean failOver) { aoqi@0: this.key = key; aoqi@0: this.replicaInstance = replicaInstance; aoqi@0: this.failOver = failOver; aoqi@0: } aoqi@0: aoqi@0: public String getReplicaInstance() { aoqi@0: return replicaInstance; aoqi@0: } aoqi@0: aoqi@0: public String getKey() { aoqi@0: return key; aoqi@0: } aoqi@0: aoqi@0: public boolean isFailOver() { aoqi@0: return failOver; aoqi@0: } aoqi@0: }