org.omg.FT
Class Utils

java.lang.Object
  |
  +--org.omg.FT.Utils

public class Utils
extends java.lang.Object

This class mainly contains static methods and fields (constants) used as utilities (for example it contains methods to do conversions from byte arrays to long and back, methods to read IOR profiles, etc.). Other utilities can be written if needed. Also, the author can be contacted to provide some methods that are not in this file, but might needed for the well functioning of the infrastructure.


Inner Class Summary
static class Utils.FTDomInfo
          Class containing info about the fault tolerance domain - name and hosts
 
Field Summary
static java.lang.Object BACKUP_SYNCH
           
static int BEG_SYNCH_FAILOVER
          constant (used in time tracing) indicating the moment when in the gateway server interceptor, reading of the current membership of the active group starts to wait for a possible failover procedure that takes place at the same time and leads to a change in the group
static int CALL_INVOKE
          constant (used in time tracing) indicating the moment when in the client interceptor (at the active group member) the "invoke" method is called on the gateway when the active server group becomes a client for a third tier server
static int END_CALL_BY_CLIENT
          constant (used in time tracing) indicating that the client received the reply at the level of the application
static int END_SYNCH_FAILOVER
          constant (used in time tracing) indicating the moment when in the gateway server interceptor the group membership is read after waiting for a possible failover to take place
static int ENTER_RECEIVE_REPLY
          constant (used in time tracing) indicating the moment when the client interceptor is entered when the reply is received by the client
static int ENTER_RECEIVE_REQUEST
          constant (used in time tracing) indicating the moment when the server interceptor is entered when receiving the request at the server
static int ENTER_RECEIVE_REQUEST_G
          constant (used in time tracing) indicating the moment when the gateway's server interceptor is entered when a request is received from the client to be broadcast to all replicas of an actively replicated server
static int ENTER_SEND_REPLY
          constant (used in time tracing) indicating the moment when the server interceptor is entered when the reply is sent to the client after the request was processed in the server
static int ENTER_SEND_REQUEST
          constant (used in time tracing) indicating the moment when the client interceptor is entered when the request is sent to the server
static int EXIT_RECEIVE_REPLY
          constant (used in time tracing) indicating the moment when the client interceptor is exited when the reply is received by the client
static int EXIT_RECEIVE_REQUEST
          constant (used in time tracing) indicating the moment when the request receiving method in the server interceptor is exited
static int EXIT_REPLY_ALREADY_THERE
          constant (used in time tracing) indicating the moment when the server interceptor (at receiving of the request) is exited because the reply to the request is already logged; thus, the request is not executed again and the answer is directly sent to the client
static int EXIT_SEND_REPLY
          constant (used in time tracing) indicating the moment when the server interceptor is exited when sending the reply to the client
static int EXIT_SEND_REPLY_GW
          constant (used in time tracing) indicating the moment when the gateway server interceptor is exited when sending a reply to the client request
static int EXIT_SEND_REQUEST
          constant (used in time tracing) indicating the moment when the client interceptor is exited when sending the request
private static java.lang.String ft_dom_name_fn
          path of the file containing the host names from the fault tolerance domain SHOULD BE CHANGED TO FIT NEEDS!!
static int GET_ANSWER_GW
          constant (used in time tracing) indicating the moment when in the server interceptor (at the gateway) the answer to a request sent out on behalf of the actively replicated group is received
static int GW_SEND_REQUESTS
          constant (used in time tracing) indicating the moment when in the server interceptor at the gateway, the client request was sent to the replicas of the active group
static int GW_SEND_TRANSIENT
          constant (used in time tracing) indicating the moment when in the gateway sends a TRANSIENT exception to the client calling a method on the actively replicated server
static int INV_EXITS_SEND_REQUEST
          constant (used in time tracing) indicating the moment when in the client interceptor (at the active group member) the method send_request is exited, when the invoke method is called
static char READ
          read-only method
static int REC_GET_STATE_REPLY
          constant (used in time tracing) indicating the moment when in the client interceptor (at the logging_recovery CORBA object) a reply to get_state request is received from the server object that is checkpointed
static int REC_GET_STATE_REQ
          constant (used in time tracing) indicating the moment when in the server interceptor at the server replica a get_state request is received
static int REC_GET_UPDATE_REPLY
          constant (used in time tracing) indicating the moment when in the client interceptor (at the logging_recovery CORBA object) a reply to get_update request is received from the server object that is checkpointed
static int REC_GET_UPDATE_REQ
          constant (used in time tracing) indicating the moment when in the server interceptor at the server replica a get_update request is received
static int RECEIVE_EXCEPTION
          constant (used in time tracing) indicating the moment when a client interceptor's receive_exception method is called showing that the server sent an exception as a result of the request execution
static int RECEIVE_FIRST_REPLY
          constant (used in time tracing) indicating the moment when in the server interceptor (at the gateway) the first reply (from the fastest replica) is received
static int RECEIVE_OTHER
          constant (used in time tracing) indicating the moment when in a client interceptor's receive_other method is called showing that the server sent something similar to an exception back to the client
static int REPL_MAN_BEG_GET_STATE
          constant (used in time tracing) indicating the moment when, while in the fail over process of a group, the Replication Manager reads the state of a replica (in case of active replication) to be transferred to a newly created replica.
static int REPL_MAN_BEG_SET_STATE
          constant (used in time tracing) indicating the moment when the Replication Manager starts setting the state on a new replica of an active group
static int REPL_MAN_BEGIN_CR_OBJ
          constant (used in time tracing) indicating the moment when the Replication Manager starts creating a new replica when the number of members of the group that are up drops under the minimum number replicas limit
static int REPL_MAN_BEGIN_REC
          constant (used in time tracing) indicating the moment when the replication manager starts the recovery (failover) process of a group in which a replica failed (this time trace is put in the Replication Manager)
static int REPL_MAN_END_CR_OBJ
          constant (used in time tracing) indicating the moment when the Replication Manager finishes the creation of the new replica
static int REPL_MAN_END_GET_STATE
          constant (used in time tracing) indicating the moment when, while in the failover process of a group, the Replication Manager ends the state reading
static int REPL_MAN_END_REC
          constant (used in time tracing) indicating the moment when the Replication Manager ends the recovery (failover) process for a group
static int REPL_MAN_END_SET_STATE
          constant (used in time tracing) indicating the moment when the Replication Manager ends setting the state on a new replica of an active group
static int REPL_MAN_REC_F_NOT
          constant (used in time tracing) indicating the moment when the replication manager received a fault notification from the failure notifier
private static java.lang.Object semaphor
           
static int SEND_EXCEPTION
          constant (used in time tracing) indicating the moment when in the server interceptor (at returning after a request) an exception is sent to the client (the method send_exception in the server interceptor is called)
static int SEND_EXCEPTION_RM
          constant (used in time tracing) indicating the moment when in the server interceptor at the Replication Manager (at returning after a request) an exception is sent to the client (the method send_exception in the server interceptor is called)
static int SEND_FORWARD_EXC
          constant (used in time tracing) indicating the moment when in the server interceptor (at receiving of the request) it is found out that the client knows a different group reference version than the server ORB; thus, a ForwardRequest exception is sent to the client containing the new version of the group reference
static int SEND_GET_STATE_REPLY
          constant (used in time tracing) indicating the moment when in the server interceptor at the server replica a reply to a get_state request is sent to the checkpointing object
static int SEND_GET_STATE_REQ
          constant (used in time tracing) indicating the moment when in the client interceptor (at the logging_recovery CORBA object) a get_state request is intercepted when it is sent to the server object to be checkpointed
static int SEND_GET_UPDATE_REPLY
          constant (used in time tracing) indicating the moment when in the server interceptor at the server replica a reply to a get_update request is sent to the checkpointing object
static int SEND_GET_UPDATE_REQ
          constant (used in time tracing) indicating the moment when in the client interceptor (at the logging_recovery CORBA object) a get_update request is intercepted when it is sent to the server object to be checkpointed
static int SEND_OTHER
          constant (used in time tracing) indicating the moment when in the server interceptor (at returning after a request) something similar to an exception is sent to the client (the method send_other in the server interceptor is called)
static int SEND_OTHER_RM
          constant (used in time tracing) indicating the moment when in the server interceptor at the Replication Manager (at returning after a request) something similar to an exception is sent to the client (the method send_exception in the server interceptor is called)
static int SEND_REQ_EXP_EXC
          constant (used in time tracing) indicating the moment when in the server interceptor (at receiving of the request) it is found out that the request expiration time was exceeded
static int SEND_REQ_EXP_EXC_GW
          constant (used in time tracing) indicating the moment when in the server interceptor (at the gateway) it is found out that the request expiration time was exceeded and a corresponding exception is sent to the client
static int SEND_WR_PRIM_EXC
          constant (used in time tracing) indicating the moment when in the server interceptor (at receiving of the request) it is found out that the request arrived to the wrong replica (not yet the primary); thus, a TRANSIENT exception is sent to the client
static int START_CALL_BY_CLIENT
          constant (used in time tracing) indicating the moment of start of the CORBA call in the client appl.
static int START_GET_S_WAIT
          constant (used in time tracing) indicating the moment when the call to get_state is initiated, but has to wait until all update method calls processing it will finish
static int START_GET_STATE_CALL
          constant (used in time tracing) indicating the moment the call to get_state on a server replica starts (this trace is usually placed in the object that does checkpointing)
static int START_GET_U_WAIT
          constant (used in time tracing) indicating the moment when the call to get_update is initiated, but has to wait until all update method calls processing it will finish
static int START_GET_UPDATE
          constant (used in time tracing) indicating the moment the call to get_update (reading of state change) on a server replica starts (this trace is usually placed in the object that does checkpointing)
static int START_GET_UPDATE_CALL
          constant (used in time tracing) indicating the moment the call to get_update on a server replica starts (this trace is usually placed in the object that does checkpointing)
static int START_REC_BR_METHOD_CALL
          constant (used in time tracing) indicating the moment when in the server interceptor (at receiving of the request) for warm passive replication, the call information starts to be recorded by use of the Logging Recovery Mechanism (BR is short for broadcasting)
static int START_REC_BR_REPLY
          constant (used in time tracing) indicating the moment when in the server interceptor (at replying to the request) for warm passive replication, the reply information starts to be recorded by use of the Logging Recovery Mechanism (BR is short for broadcasting)
static int START_REC_METHOD_CALL
          constant (used in time tracing) indicating the moment when in the server interceptor (at receiving of the request) for cold passive replication, the call information starts to be recorded by use of the Logging Recovery Mechanism
static int START_REC_REPLY
          constant (used in time tracing) indicating the moment when in the server interceptor (at replying to the request) for cold passive replication, the reply information starts to be recorded by use of the Logging Recovery Mechanism
static int START_SET_STATE
          constant (used in time tracing) indicating when the setting of the state (by call to set_state) on a recovering replica (in cold passive replication) is started
static int START_STATE_REC
          constant (used in time tracing) indicating the moment when the recording of the state in the log starts (this trace should be placed in the object that does the checkpointing)
static int START_UPDATE_REC
          constant (used in time tracing) indicating the moment when the recording of the state change (update) in the log starts (this trace should be placed in the object that does the checkpointing)
static int START_WAIT_ANSWER_GW
          constant (used in time tracing) indicating the moment when the gateway starts waiting for the answer to a request that it sent out on behalf of the actively replicated server group, to a third-tier server
static int START_WAIT_UPD_OPER
          constant (used in time tracing) indicating the moment when an update operation (when logged) waits for other update operations arrived before it to finish execution
static int STOP_GET_S_WAIT
          constant (used in time tracing) indicating the moment when the call to get_state can start, since all update methods executing in front of it finished
static int STOP_GET_STATE_CALL
          constant (used in time tracing) indicating the moment the call to get_state on a server replica ends (this trace is usually placed in the object that does checkpointing)
static int STOP_GET_U_WAIT
          constant (used in time tracing) indicating the moment when the call to get_update can start, since all update methods executing in front of it finished
static int STOP_GET_UPDATE
          constant (used in time tracing) indicating the moment the call to get_update on a server replica ends (this trace is usually placed in the object that does checkpointing)
static int STOP_GET_UPDATE_CALL
          constant (used in time tracing) indicating the moment the call to get_update on a server replica ends (this trace is usually placed in the object that does checkpointing)
static int STOP_REC_BR_METHOD_CALL
          constant (used in time tracing) indicating the moment when in the server interceptor (at receiving of the request) for warm passive replication, the call information recording stops
static int STOP_REC_BR_REPLY
          constant (used in time tracing) indicating the moment when in the server interceptor (at replying to the request) for warm passive replication, the reply information recording stops
static int STOP_REC_METHOD_CALL
          constant (used in time tracing) indicating the moment when in the server interceptor (at receiving of the request) for cold passive replication, the call information recording stops
static int STOP_REC_REPLY
          constant (used in time tracing) indicating the moment when in the server interceptor (at replying to the request) for cold passive replication, the reply information recording stops
static int STOP_SET_STATE
          constant (used in time tracing) indicating when the setting of the state (by call to set_state) on a recovering replica (in cold passive replication) is ended (the interval STOP_SET_STATE-START_SET_STATE is important to consider as a part of the failover time)
static int STOP_STATE_REC
          constant (used in time tracing) indicating the moment when the recording of the state in the log ends (this trace should be placed in the object that does the checkpointing)
static int STOP_UPDATE_REC
          constant (used in time tracing) indicating the moment when the recording of the update in the log ends (this trace should be placed in the object that does the checkpointing)
static int STOP_WAIT_UPD_OPER
          constant (used in time tracing) indicating the moment when an update operation is ready to be executed on the server after all update methods arrived before it executed
static int THROW_REPLY_HERE
          constant (used in time tracing) indicating the moment when an exception is thrown in the client interceptor, saying that the answer to an outgoing request from the replicated server group is at the server
static char UPDATE_NON_VOID
          update method - return type is not void
static char UPDATE_ONEWAY
          oneway update method
static char UPDATE_VOID
          update-only method (return type is void)
static int YES_REQUEST_RIGHT_PLACE
          constant (used in time tracing) indicating the moment when in the server interceptor (at receiving of the request) it is found out that the request is at the right replica (primary) - this constant is used in passive replication
 
Constructor Summary
Utils()
           
 
Method Summary
static java.util.Hashtable[] a_minus_b_a_inters_b_b_minus_a(java.util.Hashtable a, java.util.Hashtable b)
          Method used to obtain the differences A-B and B-A and the intersection of two sets represented as Hashtables
static long[][] a_minus_b_b_minus_a(long[] a, long[] b)
          Method used to obtain the differences A-B and B-A of two sets represented as arrays of long
static byte[] add_ret_id_state(byte[] state, int ret_id)
          This method modifies the state array of bytes by inserting in the beginning of the array four octets that represent the integer retention identifier
static org.omg.CosNaming.NamingContext bind_context(org.omg.CosNaming.NamingContext ncx, org.omg.CosNaming.NameComponent[] ncs)
           
static org.omg.IOP.TaggedProfile body_profile(org.omg.CORBA.ORB orb, org.omg.IIOP.ProfileBody_1_1 pb11)
           
static boolean byte_a_equal(byte[] a1, byte[] a2)
          Tests whether two byte arrays are equal e.g. {
static org.omg.IOP.IOR change_primary(org.omg.CORBA.ORB orb, org.omg.IOP.IOR group_ior, org.omg.IOP.IOR pr_ior, boolean change_gr_v)
          change the primary member of the object group to be a different member of the same group; thus, pr_ior has profiles which can be found in group_ior
static universal.Outcome elementAt(java.util.Vector reg, int k)
          Method that returns the element in the Outcome vector (used in FA-CORBA infrastructure) that corresponds to an update that happened after k number of requests processed Since the number of records in the vector is not the sane as the requests processed, in order to return the element "k", it is not possible to return the element on position k, but the element for which the field after_n_req is k
private static void exec_meth(java.lang.Object obj, long o_i, LogRecord[] last_req, LoggingRecoveryController cb, MethSignStr[] method_sign, org.omg.CORBA.ORB orb)
          Method used in replay_last_requests to replay the logged methods on the recoverin bakup
static org.omg.IOP.TaggedProfile ext_profile_tag(org.omg.CORBA.ORB orb, org.omg.IOP.TaggedProfile pr, org.omg.CORBA.portable.IDLEntity tftc, int tag)
           
static java.lang.String extract_ft_dom_n(org.omg.CORBA.ORB orb, org.omg.CORBA.Object ref)
           
static long extract_group_id(org.omg.CORBA.ORB orb, org.omg.IOP.IOR ior)
           
static long extract_group_id(org.omg.CORBA.ORB orb, org.omg.CORBA.Object obj)
           
static long[] extract_group_vers_and_id(org.omg.CORBA.ORB orb, org.omg.IOP.TaggedProfile profile)
           
static int extract_group_version(org.omg.CORBA.ORB orb, org.omg.IOP.IOR ior)
           
static int extract_group_version(org.omg.CORBA.ORB orb, org.omg.IOP.TaggedComponent tc)
           
static int extract_group_version(org.omg.CORBA.ORB orb, org.omg.IOP.TaggedProfile profile)
           
static java.lang.Object extract_obj_from_any(org.omg.CORBA.Any any)
           
static long extract_oid_l(java.lang.String id)
           
static byte[] extract_oid(java.lang.String id)
           
static boolean extract_primary(org.omg.CORBA.ORB orb, org.omg.IOP.TaggedComponent component)
           
static int extract_repl_style(org.omg.CORBA.ORB orb, org.omg.IOP.TaggedProfile tp)
           
static org.omg.IOP.TaggedComponent extract_tagged_comp(org.omg.CORBA.ORB orb, org.omg.IOP.TaggedProfile t_prof)
           
static java.lang.String get_class_helper_s(java.lang.String class_n)
           
static java.lang.String get_class_helper(java.lang.String type_id)
           
static java.lang.String get_class_name(java.lang.String type_id)
          Method used to return the class name corresponding to a type identifier Example: the type identifier IDL:a/b/c/D:1.0 has the corresponding stub class name a.b.c.D (a.b.c is the name of the package)
static java.lang.Class get_class(java.lang.String type_id)
          Method used to return the stub class corresponding to a type identifier Example: the type identifier IDL:a/b/c/D:1.0 has the corresponding stub class name a.b.c._DStub (a.b.c is the name of the package)
static CallLogRecord get_clr(int disc, SomeLogRecord slr)
           
static org.omg.IOP.IOR get_ior(org.omg.CORBA.Object obj)
           
static org.omg.IOP.IOR get_ior(org.omg.CORBA.Object[] obj)
           
static org.omg.CORBA.Any give_any_arg(org.omg.CORBA.ORB orb, java.lang.Object value)
          Method used to insert the content of a Java object in an any structure, based on the type of the object
static org.omg.CORBA.Any give_any(org.omg.CORBA.ORB orb, java.lang.Object result, boolean holder)
           
static java.lang.String give_class_name(org.omg.CORBA.Any any)
           
static java.lang.String give_location(org.omg.CORBA.ORB orb, org.omg.IOP.IOR ior)
           
static java.lang.String give_location(org.omg.CORBA.ORB orb, org.omg.CORBA.Object obj)
           
static java.lang.String[] give_locations(org.omg.CORBA.ORB orb, org.omg.IOP.IOR ior)
           
private static java.lang.Object give_object_holder(org.omg.CORBA.Any any, boolean typecode_only)
          Method used to return a holder object corresponding to an any object that is supposed to be modified by a method that receives it as out or inout parameter
private static java.lang.Object give_object(org.omg.CORBA.Any any)
          This method is used when reexecuting methods that where logged when the primary was up, and their parameters where remembered in an Any format; at replay, the parameters are needed by the reflection operations in object formats
static boolean has_primary(org.omg.CORBA.ORB orb, org.omg.CORBA.Object group)
           
static java.lang.Object holder_with_value(org.omg.CORBA.Any any, boolean typecode_only)
          Method used to return an object corresponding to an instance of the Holder class of the object contained by the Any; the instance of the holder class will contain as value the content of the Any
private static boolean include(org.omg.CosNotification.Property[] a, org.omg.CosNotification.Property[] b)
          Method used to determine whether one set is a subset of another (sets are expressed as CosNotification.Property arrays)
static void insert_obj_read_seq(org.omg.CORBA.Any any, org.omg.CORBA.portable.InputStream input, org.omg.CORBA.TypeCode seq_tc)
          similar to insert_obj_read, just that the object read from the input stream is a sequence (array) of elements whose typecode is given as parameter
static void insert_obj_read(org.omg.CORBA.Any any, org.omg.CORBA.portable.InputStream input)
           
static void invoke_helper_method(java.lang.String oper, java.lang.String class_n, java.lang.Object[] params)
          Method used to invoke the operation oper from the helper class of the class with name class_n, with parameters params
static boolean is_group_ref(org.omg.CORBA.ORB orb, org.omg.IOP.IOR ior)
           
static boolean is_primary(org.omg.CORBA.ORB orb, org.omg.IOP.IOR ior, java.lang.String location)
           
static boolean is_primary(org.omg.CORBA.ORB orb, org.omg.CORBA.Object obj, java.lang.String location)
           
static boolean is_read_method(java.lang.String mn, MethStr[] method_table)
          Method used to check whether a certain method of the server is read-only or update (using the method signature table)
static boolean is_true(boolean[] array, int how_many)
           
static java.lang.String[] makeByteArgs(byte[] id)
           
static long makeByteId(byte[] id)
           
static int makeByteInt(byte[] b)
           
static byte[] makeIdByte(long id)
           
static byte[] makeIntByte(int nr)
           
static byte[] makeShortByte(short v)
           
static double max(double[] arr)
           
static int max(int i, int j)
           
static org.omg.IOP.IOR merge_unique_iors(java.lang.String type_id, org.omg.IOP.IOR[] iors)
           
static MethSignStr method_structure(java.lang.String mn, MethSignStr[] method_table)
          Method used to return the method signature for the method with name mn
static char method_type(java.lang.String mn, MethSignStr[] method_table)
          Method used to return the type of a server method
static double min(double[] arr)
           
static int min(int i, int j)
           
static java.util.Hashtable minus(java.util.Hashtable set_a, java.util.Hashtable set_b)
          Method used to obtain the difference of two sets represented as Hashtables
static long[] minus(long[] a, long[] b)
          Method used to obtain the difference of two sets represented as arrays of long
static java.lang.Object narrow(org.omg.CORBA.Object obj, java.lang.String type_id)
          Method used to call the narrow method of the helper class of the type identifier type_id, with the obj as parameter
static org.omg.CosNotification.Property[] parse_constraint_expr(java.lang.String constraint_expr)
          Method used to extract properties used in filtering events, from aconsraint expression given as parameter
static Utils.FTDomInfo[] parse_ft_dom_file_i(java.lang.String file_name)
          Method used to read the host names form the FT domain from the file with name file_name
static java.lang.String[] parse_ft_dom_file(java.lang.String ft_dom_name)
          Method used to parse the file where the host names from the FT domain are and return their list where the filename is hard coded
static boolean pass_filter(org.omg.CosNotification.StructuredEvent e, org.omg.CosNotifyFilter.Filter f)
          Method called to decide whether an event (StructuredEvent) has to be sent or not to a certain consumer, based on the filter information (what events it is interested in) provided about that consumer
static int primary_prof_ind(org.omg.CORBA.ORB orb, org.omg.IOP.IOR ior)
           
static void print_IOR(org.omg.CORBA.ORB orb, org.omg.IOP.IOR ior)
          Method used to print an IOR in a readable format - giving host name, port number,etc.
static void print_profile(org.omg.CORBA.ORB orb, org.omg.IOP.TaggedProfile pr)
           
static org.omg.IIOP.ProfileBody_1_1 profile_body(org.omg.CORBA.ORB orb, org.omg.IOP.TaggedProfile tp)
           
static boolean profiles_eq(org.omg.CORBA.ORB orb, org.omg.IIOP.ProfileBody_1_1 pr1, org.omg.IIOP.ProfileBody_1_1 pr2)
          Method used to check whether two tagged profiles are equal (identical) or not by comparing the profile bodies
static boolean profiles_eq(org.omg.CORBA.ORB orb, org.omg.IOP.TaggedProfile pr1, org.omg.IOP.TaggedProfile pr2)
          Method used to check whether two tagged profiles are equal (identical) or not (uses the comparison of profile bodies)
static java.util.Vector prop_v_union_o(java.util.Vector v1, java.util.Vector v2, java.util.Vector v3)
          Method that uses prop_v_union twice to realize the union of three vectors
static java.util.Vector prop_v_union(java.util.Vector v1, java.util.Vector v2, int override)
          Method used to return the union of two sets represented as Vectors, one of them overriding the other; this means that the elements of one of the vectors (the non-overriding one) that are not present in the other one have to be inserted first in the union
static void prune_outcome_vector(java.util.Vector reg, int k)
          Method used in the FA-CORBA infrastructure when the outcome register of a witness has to be reduced, by removing the update records since the last state record, and replace them by one state record
private static org.omg.Dynamic.Parameter[] read_args(org.omg.CORBA.ORB orb, MethSignStr method_s, org.openorb.iiop.CDRInputStream is)
          method used to read (demarshal) the arguments of a call from a stream, knowing the types of the arguments from the method signatures table This method is used when replaying methods on the recovering backup, by using nformation from the log of call information
static void read_input_stream(org.omg.CORBA.portable.InputStream input, org.omg.CORBA.Any guide, boolean typecode_only)
          Method ued in the gateway server request interceptor when the gateway acts as an intermediate between the client and the replicated server group and broadcasts requests to the group members; the gateway has to read arguments to calls from the input stream and demarshal those
static long[] readlongObject(java.io.ObjectInputStream ois)
          Method used to read an array of long from an Object Input Stream
static byte[] readRealState(byte[] fake_state)
          This method extracts the real state a fake state array (the octets after position four)
static int readRetId(byte[] fake_state)
          This method extracts the retention identifier from a fake state array (the first four octets)
static boolean refs_equal(org.omg.CORBA.ORB orb, org.omg.CORBA.Object ref1, org.omg.CORBA.Object ref2, int how_many_profiles)
          Method used to check if two CORBA object references are identical by checking the equality of their profiles
static java.lang.String repl_s_string(int repl_s)
           
static void replay_last_requests(java.lang.Object the_obj, long obj_id, LogRecord[] last_requests, LogRecord[] last_requests_nr, LoggingRecoveryController callback, int retention_id, org.openorb.CORBA.ORB orb, MethSignStr[] methods)
          Method called when at failver requests have to be replayed on the recovering backup (in passive replication)
static org.omg.CosNaming.NamingContext resolve_n(org.omg.CosNaming.NamingContext ncx, org.omg.CosNaming.NameComponent[] ncs)
           
static void set_false(boolean[] array, int where)
           
static void set_true(boolean[] array)
           
static void trace(int which_replica, int moment_code, int retention_id, java.lang.String client_id, long time, java.lang.String oper_name, java.io.RandomAccessFile raf)
          Method used to record time traces for measurement purposes in active replication
static void trace(int moment_code, int size, long time, long obj_id, java.io.RandomAccessFile raf)
          Method used to record time traces for measurement purposes
static void trace(int moment_code, int retention_id, java.lang.String client_id, long time, java.lang.String oper_name, java.io.RandomAccessFile raf)
          Method used to record time traces for measurement purposes
static void trace(int moment_code, long group_id, int nr_of_repl, int replication_s, long time, java.io.RandomAccessFile raf)
          Method used to record time traces for measurement purposes
static void trace(java.lang.String message, java.io.RandomAccessFile raf)
          Method used to write a message in a file
static java.lang.String type_id(org.omg.CORBA.Object o)
           
static void type_id(java.lang.String type_id, org.omg.CORBA.Object o)
           
static org.omg.IOP.IOR update_group_ior_add_pr(org.omg.CORBA.ORB orb, org.omg.IOP.IOR ior, org.omg.IOP.IOR extra_ior, int position, boolean change_group_v)
          The same as update_group_ior_add with the exception that the added group member becomes the primary (because there was no other backup to become the primary)
static org.omg.IOP.IOR update_group_ior_add(org.omg.CORBA.ORB orb, org.omg.IOP.IOR ior, org.omg.IOP.IOR extra_ior, int position, boolean change_group_v)
           
static org.omg.IOP.IOR update_group_ior_rem(org.omg.CORBA.ORB orb, org.omg.IOP.IOR ior, org.omg.IOP.IOR rem_ior, boolean change_group_v)
           
static void write_obj_extract_seq(org.omg.CORBA.Any any, org.omg.CORBA.portable.OutputStream os, org.omg.CORBA.TypeCode seq_tc)
          Method similar to write_obj_extract, but the content of the Any object is a sequence of elementa´s whose typecode is given as a parameter (seq_tc)
static void write_obj_extract(org.omg.CORBA.Any any, org.omg.CORBA.portable.OutputStream os)
           
static void write_output_stream(org.omg.CORBA.Any any, org.omg.CORBA.portable.OutputStream os)
          Method used when a request does not need to be executed on the server and the reply is sent from the level of the server interceptor this method does marshaling of the arguments to be sent to the client as an answer
static void writelongObject(java.io.ObjectOutputStream oos, long[] obj)
          Method used to write an array of long to an Object Output Stream
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

semaphor

private static java.lang.Object semaphor

ft_dom_name_fn

private static java.lang.String ft_dom_name_fn
path of the file containing the host names from the fault tolerance domain SHOULD BE CHANGED TO FIT NEEDS!! OR EVEN MAKE IT NOT HARD CODED!!

UPDATE_VOID

public static final char UPDATE_VOID
update-only method (return type is void)

UPDATE_NON_VOID

public static final char UPDATE_NON_VOID
update method - return type is not void

UPDATE_ONEWAY

public static final char UPDATE_ONEWAY
oneway update method

READ

public static final char READ
read-only method

START_CALL_BY_CLIENT

public static final int START_CALL_BY_CLIENT
constant (used in time tracing) indicating the moment of start of the CORBA call in the client appl.

EXIT_SEND_REQUEST

public static final int EXIT_SEND_REQUEST
constant (used in time tracing) indicating the moment when the client interceptor is exited when sending the request

ENTER_RECEIVE_REQUEST

public static final int ENTER_RECEIVE_REQUEST
constant (used in time tracing) indicating the moment when the server interceptor is entered when receiving the request at the server

YES_REQUEST_RIGHT_PLACE

public static final int YES_REQUEST_RIGHT_PLACE
constant (used in time tracing) indicating the moment when in the server interceptor (at receiving of the request) it is found out that the request is at the right replica (primary) - this constant is used in passive replication

SEND_FORWARD_EXC

public static final int SEND_FORWARD_EXC
constant (used in time tracing) indicating the moment when in the server interceptor (at receiving of the request) it is found out that the client knows a different group reference version than the server ORB; thus, a ForwardRequest exception is sent to the client containing the new version of the group reference

SEND_WR_PRIM_EXC

public static final int SEND_WR_PRIM_EXC
constant (used in time tracing) indicating the moment when in the server interceptor (at receiving of the request) it is found out that the request arrived to the wrong replica (not yet the primary); thus, a TRANSIENT exception is sent to the client

SEND_REQ_EXP_EXC

public static final int SEND_REQ_EXP_EXC
constant (used in time tracing) indicating the moment when in the server interceptor (at receiving of the request) it is found out that the request expiration time was exceeded

EXIT_RECEIVE_REQUEST

public static final int EXIT_RECEIVE_REQUEST
constant (used in time tracing) indicating the moment when the request receiving method in the server interceptor is exited

ENTER_SEND_REPLY

public static final int ENTER_SEND_REPLY
constant (used in time tracing) indicating the moment when the server interceptor is entered when the reply is sent to the client after the request was processed in the server

EXIT_SEND_REPLY

public static final int EXIT_SEND_REPLY
constant (used in time tracing) indicating the moment when the server interceptor is exited when sending the reply to the client

ENTER_RECEIVE_REPLY

public static final int ENTER_RECEIVE_REPLY
constant (used in time tracing) indicating the moment when the client interceptor is entered when the reply is received by the client

EXIT_RECEIVE_REPLY

public static final int EXIT_RECEIVE_REPLY
constant (used in time tracing) indicating the moment when the client interceptor is exited when the reply is received by the client

END_CALL_BY_CLIENT

public static final int END_CALL_BY_CLIENT
constant (used in time tracing) indicating that the client received the reply at the level of the application

ENTER_RECEIVE_REQUEST_G

public static final int ENTER_RECEIVE_REQUEST_G
constant (used in time tracing) indicating the moment when the gateway's server interceptor is entered when a request is received from the client to be broadcast to all replicas of an actively replicated server

BEG_SYNCH_FAILOVER

public static final int BEG_SYNCH_FAILOVER
constant (used in time tracing) indicating the moment when in the gateway server interceptor, reading of the current membership of the active group starts to wait for a possible failover procedure that takes place at the same time and leads to a change in the group

END_SYNCH_FAILOVER

public static final int END_SYNCH_FAILOVER
constant (used in time tracing) indicating the moment when in the gateway server interceptor the group membership is read after waiting for a possible failover to take place

EXIT_SEND_REPLY_GW

public static final int EXIT_SEND_REPLY_GW
constant (used in time tracing) indicating the moment when the gateway server interceptor is exited when sending a reply to the client request

GW_SEND_TRANSIENT

public static final int GW_SEND_TRANSIENT
constant (used in time tracing) indicating the moment when in the gateway sends a TRANSIENT exception to the client calling a method on the actively replicated server

GW_SEND_REQUESTS

public static final int GW_SEND_REQUESTS
constant (used in time tracing) indicating the moment when in the server interceptor at the gateway, the client request was sent to the replicas of the active group

RECEIVE_FIRST_REPLY

public static final int RECEIVE_FIRST_REPLY
constant (used in time tracing) indicating the moment when in the server interceptor (at the gateway) the first reply (from the fastest replica) is received

ENTER_SEND_REQUEST

public static final int ENTER_SEND_REQUEST
constant (used in time tracing) indicating the moment when the client interceptor is entered when the request is sent to the server

CALL_INVOKE

public static final int CALL_INVOKE
constant (used in time tracing) indicating the moment when in the client interceptor (at the active group member) the "invoke" method is called on the gateway when the active server group becomes a client for a third tier server

INV_EXITS_SEND_REQUEST

public static final int INV_EXITS_SEND_REQUEST
constant (used in time tracing) indicating the moment when in the client interceptor (at the active group member) the method send_request is exited, when the invoke method is called

START_WAIT_ANSWER_GW

public static final int START_WAIT_ANSWER_GW
constant (used in time tracing) indicating the moment when the gateway starts waiting for the answer to a request that it sent out on behalf of the actively replicated server group, to a third-tier server

GET_ANSWER_GW

public static final int GET_ANSWER_GW
constant (used in time tracing) indicating the moment when in the server interceptor (at the gateway) the answer to a request sent out on behalf of the actively replicated group is received

THROW_REPLY_HERE

public static final int THROW_REPLY_HERE
constant (used in time tracing) indicating the moment when an exception is thrown in the client interceptor, saying that the answer to an outgoing request from the replicated server group is at the server

REPL_MAN_BEGIN_REC

public static final int REPL_MAN_BEGIN_REC
constant (used in time tracing) indicating the moment when the replication manager starts the recovery (failover) process of a group in which a replica failed (this time trace is put in the Replication Manager)

REPL_MAN_END_REC

public static final int REPL_MAN_END_REC
constant (used in time tracing) indicating the moment when the Replication Manager ends the recovery (failover) process for a group

REPL_MAN_REC_F_NOT

public static final int REPL_MAN_REC_F_NOT
constant (used in time tracing) indicating the moment when the replication manager received a fault notification from the failure notifier

REPL_MAN_BEGIN_CR_OBJ

public static final int REPL_MAN_BEGIN_CR_OBJ
constant (used in time tracing) indicating the moment when the Replication Manager starts creating a new replica when the number of members of the group that are up drops under the minimum number replicas limit

REPL_MAN_END_CR_OBJ

public static final int REPL_MAN_END_CR_OBJ
constant (used in time tracing) indicating the moment when the Replication Manager finishes the creation of the new replica

EXIT_REPLY_ALREADY_THERE

public static final int EXIT_REPLY_ALREADY_THERE
constant (used in time tracing) indicating the moment when the server interceptor (at receiving of the request) is exited because the reply to the request is already logged; thus, the request is not executed again and the answer is directly sent to the client

RECEIVE_EXCEPTION

public static final int RECEIVE_EXCEPTION
constant (used in time tracing) indicating the moment when a client interceptor's receive_exception method is called showing that the server sent an exception as a result of the request execution

RECEIVE_OTHER

public static final int RECEIVE_OTHER
constant (used in time tracing) indicating the moment when in a client interceptor's receive_other method is called showing that the server sent something similar to an exception back to the client

SEND_REQ_EXP_EXC_GW

public static final int SEND_REQ_EXP_EXC_GW
constant (used in time tracing) indicating the moment when in the server interceptor (at the gateway) it is found out that the request expiration time was exceeded and a corresponding exception is sent to the client

SEND_EXCEPTION

public static final int SEND_EXCEPTION
constant (used in time tracing) indicating the moment when in the server interceptor (at returning after a request) an exception is sent to the client (the method send_exception in the server interceptor is called)

SEND_OTHER

public static final int SEND_OTHER
constant (used in time tracing) indicating the moment when in the server interceptor (at returning after a request) something similar to an exception is sent to the client (the method send_other in the server interceptor is called)

SEND_EXCEPTION_RM

public static final int SEND_EXCEPTION_RM
constant (used in time tracing) indicating the moment when in the server interceptor at the Replication Manager (at returning after a request) an exception is sent to the client (the method send_exception in the server interceptor is called)

SEND_OTHER_RM

public static final int SEND_OTHER_RM
constant (used in time tracing) indicating the moment when in the server interceptor at the Replication Manager (at returning after a request) something similar to an exception is sent to the client (the method send_exception in the server interceptor is called)

START_GET_UPDATE

public static final int START_GET_UPDATE
constant (used in time tracing) indicating the moment the call to get_update (reading of state change) on a server replica starts (this trace is usually placed in the object that does checkpointing)

STOP_GET_UPDATE

public static final int STOP_GET_UPDATE
constant (used in time tracing) indicating the moment the call to get_update on a server replica ends (this trace is usually placed in the object that does checkpointing)

START_REC_BR_METHOD_CALL

public static final int START_REC_BR_METHOD_CALL
constant (used in time tracing) indicating the moment when in the server interceptor (at receiving of the request) for warm passive replication, the call information starts to be recorded by use of the Logging Recovery Mechanism (BR is short for broadcasting)

STOP_REC_BR_METHOD_CALL

public static final int STOP_REC_BR_METHOD_CALL
constant (used in time tracing) indicating the moment when in the server interceptor (at receiving of the request) for warm passive replication, the call information recording stops

START_REC_BR_REPLY

public static final int START_REC_BR_REPLY
constant (used in time tracing) indicating the moment when in the server interceptor (at replying to the request) for warm passive replication, the reply information starts to be recorded by use of the Logging Recovery Mechanism (BR is short for broadcasting)

STOP_REC_BR_REPLY

public static final int STOP_REC_BR_REPLY
constant (used in time tracing) indicating the moment when in the server interceptor (at replying to the request) for warm passive replication, the reply information recording stops

START_REC_METHOD_CALL

public static final int START_REC_METHOD_CALL
constant (used in time tracing) indicating the moment when in the server interceptor (at receiving of the request) for cold passive replication, the call information starts to be recorded by use of the Logging Recovery Mechanism

STOP_REC_METHOD_CALL

public static final int STOP_REC_METHOD_CALL
constant (used in time tracing) indicating the moment when in the server interceptor (at receiving of the request) for cold passive replication, the call information recording stops

START_REC_REPLY

public static final int START_REC_REPLY
constant (used in time tracing) indicating the moment when in the server interceptor (at replying to the request) for cold passive replication, the reply information starts to be recorded by use of the Logging Recovery Mechanism

STOP_REC_REPLY

public static final int STOP_REC_REPLY
constant (used in time tracing) indicating the moment when in the server interceptor (at replying to the request) for cold passive replication, the reply information recording stops

REPL_MAN_BEG_GET_STATE

public static final int REPL_MAN_BEG_GET_STATE
constant (used in time tracing) indicating the moment when, while in the fail over process of a group, the Replication Manager reads the state of a replica (in case of active replication) to be transferred to a newly created replica. Note that this is the case only when the number of replicas in the group drops under the minimum number of replicas requested for the group.

REPL_MAN_END_GET_STATE

public static final int REPL_MAN_END_GET_STATE
constant (used in time tracing) indicating the moment when, while in the failover process of a group, the Replication Manager ends the state reading

REPL_MAN_BEG_SET_STATE

public static final int REPL_MAN_BEG_SET_STATE
constant (used in time tracing) indicating the moment when the Replication Manager starts setting the state on a new replica of an active group

REPL_MAN_END_SET_STATE

public static final int REPL_MAN_END_SET_STATE
constant (used in time tracing) indicating the moment when the Replication Manager ends setting the state on a new replica of an active group

START_WAIT_UPD_OPER

public static final int START_WAIT_UPD_OPER
constant (used in time tracing) indicating the moment when an update operation (when logged) waits for other update operations arrived before it to finish execution

STOP_WAIT_UPD_OPER

public static final int STOP_WAIT_UPD_OPER
constant (used in time tracing) indicating the moment when an update operation is ready to be executed on the server after all update methods arrived before it executed

START_GET_S_WAIT

public static final int START_GET_S_WAIT
constant (used in time tracing) indicating the moment when the call to get_state is initiated, but has to wait until all update method calls processing it will finish

STOP_GET_S_WAIT

public static final int STOP_GET_S_WAIT
constant (used in time tracing) indicating the moment when the call to get_state can start, since all update methods executing in front of it finished

START_GET_U_WAIT

public static final int START_GET_U_WAIT
constant (used in time tracing) indicating the moment when the call to get_update is initiated, but has to wait until all update method calls processing it will finish

STOP_GET_U_WAIT

public static final int STOP_GET_U_WAIT
constant (used in time tracing) indicating the moment when the call to get_update can start, since all update methods executing in front of it finished

START_GET_STATE_CALL

public static final int START_GET_STATE_CALL
constant (used in time tracing) indicating the moment the call to get_state on a server replica starts (this trace is usually placed in the object that does checkpointing)

STOP_GET_STATE_CALL

public static final int STOP_GET_STATE_CALL
constant (used in time tracing) indicating the moment the call to get_state on a server replica ends (this trace is usually placed in the object that does checkpointing)

START_STATE_REC

public static final int START_STATE_REC
constant (used in time tracing) indicating the moment when the recording of the state in the log starts (this trace should be placed in the object that does the checkpointing)

STOP_STATE_REC

public static final int STOP_STATE_REC
constant (used in time tracing) indicating the moment when the recording of the state in the log ends (this trace should be placed in the object that does the checkpointing)

SEND_GET_STATE_REQ

public static final int SEND_GET_STATE_REQ
constant (used in time tracing) indicating the moment when in the client interceptor (at the logging_recovery CORBA object) a get_state request is intercepted when it is sent to the server object to be checkpointed

REC_GET_STATE_REQ

public static final int REC_GET_STATE_REQ
constant (used in time tracing) indicating the moment when in the server interceptor at the server replica a get_state request is received

SEND_GET_STATE_REPLY

public static final int SEND_GET_STATE_REPLY
constant (used in time tracing) indicating the moment when in the server interceptor at the server replica a reply to a get_state request is sent to the checkpointing object

REC_GET_STATE_REPLY

public static final int REC_GET_STATE_REPLY
constant (used in time tracing) indicating the moment when in the client interceptor (at the logging_recovery CORBA object) a reply to get_state request is received from the server object that is checkpointed

START_GET_UPDATE_CALL

public static final int START_GET_UPDATE_CALL
constant (used in time tracing) indicating the moment the call to get_update on a server replica starts (this trace is usually placed in the object that does checkpointing)

STOP_GET_UPDATE_CALL

public static final int STOP_GET_UPDATE_CALL
constant (used in time tracing) indicating the moment the call to get_update on a server replica ends (this trace is usually placed in the object that does checkpointing)

START_UPDATE_REC

public static final int START_UPDATE_REC
constant (used in time tracing) indicating the moment when the recording of the state change (update) in the log starts (this trace should be placed in the object that does the checkpointing)

STOP_UPDATE_REC

public static final int STOP_UPDATE_REC
constant (used in time tracing) indicating the moment when the recording of the update in the log ends (this trace should be placed in the object that does the checkpointing)

SEND_GET_UPDATE_REQ

public static final int SEND_GET_UPDATE_REQ
constant (used in time tracing) indicating the moment when in the client interceptor (at the logging_recovery CORBA object) a get_update request is intercepted when it is sent to the server object to be checkpointed

REC_GET_UPDATE_REQ

public static final int REC_GET_UPDATE_REQ
constant (used in time tracing) indicating the moment when in the server interceptor at the server replica a get_update request is received

SEND_GET_UPDATE_REPLY

public static final int SEND_GET_UPDATE_REPLY
constant (used in time tracing) indicating the moment when in the server interceptor at the server replica a reply to a get_update request is sent to the checkpointing object

REC_GET_UPDATE_REPLY

public static final int REC_GET_UPDATE_REPLY
constant (used in time tracing) indicating the moment when in the client interceptor (at the logging_recovery CORBA object) a reply to get_update request is received from the server object that is checkpointed

START_SET_STATE

public static final int START_SET_STATE
constant (used in time tracing) indicating when the setting of the state (by call to set_state) on a recovering replica (in cold passive replication) is started

STOP_SET_STATE

public static final int STOP_SET_STATE
constant (used in time tracing) indicating when the setting of the state (by call to set_state) on a recovering replica (in cold passive replication) is ended (the interval STOP_SET_STATE-START_SET_STATE is important to consider as a part of the failover time)

BACKUP_SYNCH

public static java.lang.Object BACKUP_SYNCH
Constructor Detail

Utils

public Utils()
Method Detail

max

public static int max(int i,
                      int j)

min

public static int min(int i,
                      int j)

max

public static double max(double[] arr)

min

public static double min(double[] arr)

set_true

public static void set_true(boolean[] array)

set_false

public static void set_false(boolean[] array,
                             int where)

is_true

public static boolean is_true(boolean[] array,
                              int how_many)

makeIdByte

public static byte[] makeIdByte(long id)
Parameters:
id - an identifier in a long format
Returns:
a byte array (8 octets) representation of the long number (for example: id=890=3*256+122, the byte aray returned is:{122,3,0,0,0,0,0,0})

makeByteArgs

public static java.lang.String[] makeByteArgs(byte[] id)

makeByteId

public static long makeByteId(byte[] id)
Parameters:
id - an identifier in a byte (octet) array format
Returns:
a long representation of the array

add_ret_id_state

public static byte[] add_ret_id_state(byte[] state,
                                      int ret_id)
This method modifies the state array of bytes by inserting in the beginning of the array four octets that represent the integer retention identifier
Parameters:
state - the state array to be extended ret_id the retention identifier
Returns:
the new extended byte array

readRetId

public static int readRetId(byte[] fake_state)
This method extracts the retention identifier from a fake state array (the first four octets)
Parameters:
fake_state - the array having in the first four positions the integer retention identifier's octets
Returns:
the integer value of the retention identifier

readRealState

public static byte[] readRealState(byte[] fake_state)
This method extracts the real state a fake state array (the octets after position four)
Parameters:
fake_state - the array having in the first four positions the integer retention identifier's octets
Returns:
the byte array representing the state

makeIntByte

public static byte[] makeIntByte(int nr)
Parameters:
id - an identifier in an int format
Returns:
a byte array (4 octets) representation of the int number (for example: id=890=3*256+122, the byte aray returned is:{122,3,0,0})

makeByteInt

public static int makeByteInt(byte[] b)
Parameters:
id - an identifier in a byte (octet) array format
Returns:
an int representation of the array

makeShortByte

public static byte[] makeShortByte(short v)
Parameters:
id - an identifier in a short format
Returns:
a byte array (2 octets) representation of the int number (for example: id=890=3*256+122, the byte aray returned is:{122,3})

extract_oid

public static byte[] extract_oid(java.lang.String id)
Parameters:
id - a String representing a client identifier (e.g. 0*ORB123214)
Returns:
a byte array representation of the object group identifier (e.g. {0,0,0,0,0,0,0,0}) as extracted from the client id

extract_oid_l

public static long extract_oid_l(java.lang.String id)
Parameters:
id - a String representing a client identifier (e.g. 0*ORB123214)
Returns:
a long representation of the object group identifier (e.g. 0) as extracted from the client id

byte_a_equal

public static boolean byte_a_equal(byte[] a1,
                                   byte[] a2)
Tests whether two byte arrays are equal e.g. {1,2,2,4} is equal to {1,2,2,4}, but is not equal with {1,3,4,2} or {1,2,2}

repl_s_string

public static java.lang.String repl_s_string(int repl_s)
Parameters:
repl_s - an int representation of the replicaton style (constants definde in the FTC IDL file)
Returns:
a String representation of the replation style

give_class_name

public static java.lang.String give_class_name(org.omg.CORBA.Any any)
Parameters:
any - an any object with a certain type
Returns:
a String representation of the type name of the object inside the any

give_any

public static org.omg.CORBA.Any give_any(org.omg.CORBA.ORB orb,
                                         java.lang.Object result,
                                         boolean holder)
Parameters:
orb - the ORB instance in which the application is running result result of a method invocation or an out/inout parameter writing when using the Java reflection (method.invoke returns an object) holder variable that indicates whether the parameter result is a simple parameter, or an inout or out variable that can be modified by the execution of a method
Returns:
an any representation of the object result

give_object

private static java.lang.Object give_object(org.omg.CORBA.Any any)
This method is used when reexecuting methods that where logged when the primary was up, and their parameters where remembered in an Any format; at replay, the parameters are needed by the reflection operations in object formats
Parameters:
any - an Any type object that has to be transformed in an object representation
Returns:
an object that is contained in the Any structure

give_object_holder

private static java.lang.Object give_object_holder(org.omg.CORBA.Any any,
                                                   boolean typecode_only)
Method used to return a holder object corresponding to an any object that is supposed to be modified by a method that receives it as out or inout parameter
Parameters:
any - the Any out/inout parameter object that has to be provided as an Object type parameter to the reflectively called method typecode_only a boolean that indicates whether inside the any the object is only given only as a type (out param) or as a real object (inout param)
Returns:
an object representation of the holder

give_any_arg

public static org.omg.CORBA.Any give_any_arg(org.omg.CORBA.ORB orb,
                                             java.lang.Object value)
Method used to insert the content of a Java object in an any structure, based on the type of the object
Parameters:
orb - the ORB on which th method caller object is running value the Java object whose value has to be inserted in th eAny structure
Returns:
the Any structure with the object inserted

read_input_stream

public static void read_input_stream(org.omg.CORBA.portable.InputStream input,
                                     org.omg.CORBA.Any guide,
                                     boolean typecode_only)
Method ued in the gateway server request interceptor when the gateway acts as an intermediate between the client and the replicated server group and broadcasts requests to the group members; the gateway has to read arguments to calls from the input stream and demarshal those
Parameters:
input - the input stream from where the parameters are read guide an Any object in which the result of the reading will be written; the guide contains at the time of the call, the type of the object to be read from the stream typecode_only a boolean value indicating whether the guide contains a value (e.g. it is an INOUT parameter) or just the name of a type (n case of the result of a call or an OUT parameter)

get_clr

public static CallLogRecord get_clr(int disc,
                                    SomeLogRecord slr)
Parameters:
disc - a discriminator to indicate whether the call record of a call logged together with explicit parameter is looked for, or the record for a method call logged with parameter buffer information slr the log record
Returns:
the call log record given by disc

read_args

private static org.omg.Dynamic.Parameter[] read_args(org.omg.CORBA.ORB orb,
                                                     MethSignStr method_s,
                                                     org.openorb.iiop.CDRInputStream is)
                                              throws org.omg.CORBA.BAD_PARAM
method used to read (demarshal) the arguments of a call from a stream, knowing the types of the arguments from the method signatures table This method is used when replaying methods on the recovering backup, by using nformation from the log of call information
Parameters:
orb - the ORB which the replica is running method_s the method signatures table is the stream from which the arguments are demarshalled
Returns:
the list of method call arguments in the form of a Parameter array

write_output_stream

public static void write_output_stream(org.omg.CORBA.Any any,
                                       org.omg.CORBA.portable.OutputStream os)
Method used when a request does not need to be executed on the server and the reply is sent from the level of the server interceptor this method does marshaling of the arguments to be sent to the client as an answer
Parameters:
any - the parameter to be written on the output stream os the output stream

resolve_n

public static org.omg.CosNaming.NamingContext resolve_n(org.omg.CosNaming.NamingContext ncx,
                                                        org.omg.CosNaming.NameComponent[] ncs)
Parameters:
ncx - the naming context in which the object we are looking for was bound ncs the name sequence of the object we are looking for
Returns:
the CORBA object bound in the given context

bind_context

public static org.omg.CosNaming.NamingContext bind_context(org.omg.CosNaming.NamingContext ncx,
                                                           org.omg.CosNaming.NameComponent[] ncs)
Parameters:
ncx - the naming context in which to bind the new name ncs the name to be bound in the naming context
Returns:
the naming context with the new name bound

get_ior

public static org.omg.IOP.IOR get_ior(org.omg.CORBA.Object obj)
Parameters:
obj - the CORBA object for which the IOR (interoperable object reference) is requested
Returns:
the IOR for the object

get_ior

public static org.omg.IOP.IOR get_ior(org.omg.CORBA.Object[] obj)
Parameters:
obj - the CORBA object array for which the collective IOR is requested
Returns:
the collective IOR for the object array

print_IOR

public static void print_IOR(org.omg.CORBA.ORB orb,
                             org.omg.IOP.IOR ior)
Method used to print an IOR in a readable format - giving host name, port number,etc.
Parameters:
orb - the ORB on which the object is running ior the IOR that has to be printed

print_profile

public static void print_profile(org.omg.CORBA.ORB orb,
                                 org.omg.IOP.TaggedProfile pr)
Parameters:
orb - the ORB in which the object is running pr the profile of the IOR to be printed

give_location

public static java.lang.String give_location(org.omg.CORBA.ORB orb,
                                             org.omg.CORBA.Object obj)
Parameters:
orb - the ORB in which the method calling object is running obj the CORBA object whose location is asked for
Returns:
the location of the CORBA object as a String

give_location

public static java.lang.String give_location(org.omg.CORBA.ORB orb,
                                             org.omg.IOP.IOR ior)
Parameters:
orb - the ORB in which the method calling object is running ior the IOR of the CORBA object for which the location is requested
Returns:
the location of the CORBA object as a String

give_locations

public static java.lang.String[] give_locations(org.omg.CORBA.ORB orb,
                                                org.omg.IOP.IOR ior)
Parameters:
orb - the ORB in which the method calling object is running ior the collective IOR of the CORBA object set for which the locations are requested
Returns:
the locations of the CORBA objects as a String array

merge_unique_iors

public static org.omg.IOP.IOR merge_unique_iors(java.lang.String type_id,
                                                org.omg.IOP.IOR[] iors)
Parameters:
type_id - the type identifier of the IOR that will be obtained after the merge (also the type identifier of the separate IORs) iors a set of IORs that have to be assembled to a single IOR
Returns:
the IOR after the merge

prop_v_union

public static java.util.Vector prop_v_union(java.util.Vector v1,
                                            java.util.Vector v2,
                                            int override)
Method used to return the union of two sets represented as Vectors, one of them overriding the other; this means that the elements of one of the vectors (the non-overriding one) that are not present in the other one have to be inserted first in the union

prop_v_union_o

public static java.util.Vector prop_v_union_o(java.util.Vector v1,
                                              java.util.Vector v2,
                                              java.util.Vector v3)
Method that uses prop_v_union twice to realize the union of three vectors

type_id

public static java.lang.String type_id(org.omg.CORBA.Object o)

type_id

public static void type_id(java.lang.String type_id,
                           org.omg.CORBA.Object o)

ext_profile_tag

public static org.omg.IOP.TaggedProfile ext_profile_tag(org.omg.CORBA.ORB orb,
                                                        org.omg.IOP.TaggedProfile pr,
                                                        org.omg.CORBA.portable.IDLEntity tftc,
                                                        int tag)
Parameters:
orb - the ORB on which the method calling object is running pr the tagged profile that has to be extended with a new tagged component tftc the tagged component that has to be added to the profile tag the code of the tag for the tagged component
Returns:
the extended tagged profile

extract_tagged_comp

public static org.omg.IOP.TaggedComponent extract_tagged_comp(org.omg.CORBA.ORB orb,
                                                              org.omg.IOP.TaggedProfile t_prof)
Parameters:
orb - the ORB on which the method calling object is running t_prof the tagged profile from which the primary tagged component is extracted
Returns:
the tagged component with tag TAG_FT_PRIMARY

has_primary

public static boolean has_primary(org.omg.CORBA.ORB orb,
                                  org.omg.CORBA.Object group)
Parameters:
orb - the ORB o which the method calling object is running group the CORBA object representing the replicated group with the multi-profile IOR
Returns:
true if one of the profiles of the IOR contains a tagged component with tag=TAG_FT_PRIMARY

update_group_ior_add

public static org.omg.IOP.IOR update_group_ior_add(org.omg.CORBA.ORB orb,
                                                   org.omg.IOP.IOR ior,
                                                   org.omg.IOP.IOR extra_ior,
                                                   int position,
                                                   boolean change_group_v)
Parameters:
orb - the ORB in which the method calling object is running ior the IOR to be extended with new profiles extra_ior the IOR containing the extra profiles to be added to the ior position the position where the new profiles are inserted change_group_v if true it means that the group reference version has to be changed
Returns:
the new extended IOR

update_group_ior_add_pr

public static org.omg.IOP.IOR update_group_ior_add_pr(org.omg.CORBA.ORB orb,
                                                      org.omg.IOP.IOR ior,
                                                      org.omg.IOP.IOR extra_ior,
                                                      int position,
                                                      boolean change_group_v)
The same as update_group_ior_add with the exception that the added group member becomes the primary (because there was no other backup to become the primary)

update_group_ior_rem

public static org.omg.IOP.IOR update_group_ior_rem(org.omg.CORBA.ORB orb,
                                                   org.omg.IOP.IOR ior,
                                                   org.omg.IOP.IOR rem_ior,
                                                   boolean change_group_v)
Parameters:
orb - the ORB in which the method calling object is running ior the IOR that will be reduced with the profile of the failed group member rem_ior the IOR corresponding to the member that ahs to be removed from the group change_group_v if true it means that the group reference version has to be changed
Returns:
the new IOR obtained after removing the failed member's IOR

extract_group_version

public static int extract_group_version(org.omg.CORBA.ORB orb,
                                        org.omg.IOP.TaggedComponent tc)
Parameters:
orb - the ORB on which the method calling object is running tc the tagged component from which the group reference version is extracted
Returns:
the group reference version

extract_group_version

public static int extract_group_version(org.omg.CORBA.ORB orb,
                                        org.omg.IOP.TaggedProfile profile)
Parameters:
orb - the ORB on which the method calling object is running profile the tagged profile in which the tagged component that contains the group reference version resides
Returns:
the group reference version

extract_group_version

public static int extract_group_version(org.omg.CORBA.ORB orb,
                                        org.omg.IOP.IOR ior)
Parameters:
orb - the ORB on which the method calling object is running ior the IOR in which one profile is examined for the tagged component that contains the group reference version
Returns:
the group reference version

extract_group_vers_and_id

public static long[] extract_group_vers_and_id(org.omg.CORBA.ORB orb,
                                               org.omg.IOP.TaggedProfile profile)
Parameters:
orb - the ORB on which the method calling object is running profile the tagged profile in which the tagged component that contains the group reference version resides
Returns:
the group reference version and the group identifier

is_primary

public static boolean is_primary(org.omg.CORBA.ORB orb,
                                 org.omg.IOP.IOR ior,
                                 java.lang.String location)
Parameters:
orb - the ORB in which the method calling object is running ior the IOR which is checked to discover whether its member residing on host location is the primary or not location the location where the request from the client arrived
Returns:
true if the replica to which the request arrived is really the primary

is_primary

public static boolean is_primary(org.omg.CORBA.ORB orb,
                                 org.omg.CORBA.Object obj,
                                 java.lang.String location)
Parameters:
orb - the ORB in which the method calling object is running obj the CORBA object (representing the group) which is checked to discover whether its member residing on host location is the primary or not location the location where the request from the client arrived
Returns:
true if the replica to which the request arrived is really the primary

extract_primary

public static boolean extract_primary(org.omg.CORBA.ORB orb,
                                      org.omg.IOP.TaggedComponent component)
Parameters:
orb - the ORB in which the method calling object is running component the tagged component that should have the TAG_FT_PRIMARY tag
Returns:
false if either the tagged component does not have the expected tag, or if the primary field is set to false

change_primary

public static org.omg.IOP.IOR change_primary(org.omg.CORBA.ORB orb,
                                             org.omg.IOP.IOR group_ior,
                                             org.omg.IOP.IOR pr_ior,
                                             boolean change_gr_v)
change the primary member of the object group to be a different member of the same group; thus, pr_ior has profiles which can be found in group_ior
Parameters:
orb - the ORB in which the method calling object is running group_ior the IOR of the group for which the primary has to be changed pr_ior the IOR of the replica that will become the primary change_gr_v if true then the group reference version has to be changed
Returns:
the new IOR with the changed primary

extract_ft_dom_n

public static java.lang.String extract_ft_dom_n(org.omg.CORBA.ORB orb,
                                                org.omg.CORBA.Object ref)
Parameters:
orb - the ORB in which the method calling object is running ref the CORBA object reference corresponding to the group for which the fault tolerance domain name will be extracted from one of the profiles of the IOR
Returns:
the String representing the fault tolerance domain name

body_profile

public static org.omg.IOP.TaggedProfile body_profile(org.omg.CORBA.ORB orb,
                                                     org.omg.IIOP.ProfileBody_1_1 pb11)
Parameters:
orb - the ORB in which the method calling object is running pb11 the profile body that will be converted to a tagged profile
Returns:
the tagged profile

profile_body

public static org.omg.IIOP.ProfileBody_1_1 profile_body(org.omg.CORBA.ORB orb,
                                                        org.omg.IOP.TaggedProfile tp)
Parameters:
orb - the ORB in which the method calling object is running tp the tagged profile that will be converted to a profile body which has explicit fields showing host, port, etc.
Returns:
the profile body of this tagged profile

is_group_ref

public static boolean is_group_ref(org.omg.CORBA.ORB orb,
                                   org.omg.IOP.IOR ior)
Parameters:
orb - the ORB in which the method calling object is running ior the IOR which is checked whether it has a certain tagged component
Returns:
true if the IOR contains a profile that contains a tagged component with tag TAG_FT_GROUP

extract_group_id

public static long extract_group_id(org.omg.CORBA.ORB orb,
                                    org.omg.IOP.IOR ior)
Parameters:
orb - the ORB in which the method calling object is running ior the IOR which is used to extract the group identifier from
Returns:
the group identifier of the group having ior as an IOR

extract_group_id

public static long extract_group_id(org.omg.CORBA.ORB orb,
                                    org.omg.CORBA.Object obj)

extract_repl_style

public static int extract_repl_style(org.omg.CORBA.ORB orb,
                                     org.omg.IOP.TaggedProfile tp)
Parameters:
orb - the ORB in which the method calling object is running tp the tagged profile that is used to extract the replication style from
Returns:
the relication style

primary_prof_ind

public static int primary_prof_ind(org.omg.CORBA.ORB orb,
                                   org.omg.IOP.IOR ior)
Parameters:
orb - the ORB in which the method calling object is running ior the IOR which is checked to obtain the index of the primary profile
Returns:
the index of the profile containing the tagged component with tag TAG_FT_PRIMARY

minus

public static java.util.Hashtable minus(java.util.Hashtable set_a,
                                        java.util.Hashtable set_b)
Method used to obtain the difference of two sets represented as Hashtables

minus

public static long[] minus(long[] a,
                           long[] b)
Method used to obtain the difference of two sets represented as arrays of long

a_minus_b_a_inters_b_b_minus_a

public static java.util.Hashtable[] a_minus_b_a_inters_b_b_minus_a(java.util.Hashtable a,
                                                                   java.util.Hashtable b)
Method used to obtain the differences A-B and B-A and the intersection of two sets represented as Hashtables

a_minus_b_b_minus_a

public static long[][] a_minus_b_b_minus_a(long[] a,
                                           long[] b)
Method used to obtain the differences A-B and B-A of two sets represented as arrays of long

profiles_eq

public static boolean profiles_eq(org.omg.CORBA.ORB orb,
                                  org.omg.IOP.TaggedProfile pr1,
                                  org.omg.IOP.TaggedProfile pr2)
Method used to check whether two tagged profiles are equal (identical) or not (uses the comparison of profile bodies)

profiles_eq

public static boolean profiles_eq(org.omg.CORBA.ORB orb,
                                  org.omg.IIOP.ProfileBody_1_1 pr1,
                                  org.omg.IIOP.ProfileBody_1_1 pr2)
Method used to check whether two tagged profiles are equal (identical) or not by comparing the profile bodies

refs_equal

public static boolean refs_equal(org.omg.CORBA.ORB orb,
                                 org.omg.CORBA.Object ref1,
                                 org.omg.CORBA.Object ref2,
                                 int how_many_profiles)
Method used to check if two CORBA object references are identical by checking the equality of their profiles

get_class

public static java.lang.Class get_class(java.lang.String type_id)
Method used to return the stub class corresponding to a type identifier Example: the type identifier IDL:a/b/c/D:1.0 has the corresponding stub class name a.b.c._DStub (a.b.c is the name of the package)

get_class_helper

public static java.lang.String get_class_helper(java.lang.String type_id)
Returns:
helper class name corresponding to the type identifier type_id

get_class_helper_s

public static java.lang.String get_class_helper_s(java.lang.String class_n)

get_class_name

public static java.lang.String get_class_name(java.lang.String type_id)
Method used to return the class name corresponding to a type identifier Example: the type identifier IDL:a/b/c/D:1.0 has the corresponding stub class name a.b.c.D (a.b.c is the name of the package)

insert_obj_read

public static void insert_obj_read(org.omg.CORBA.Any any,
                                   org.omg.CORBA.portable.InputStream input)
Parameters:
any - the Any structure in which the read object will be inserted input the input stream from where the object to be put in the Any is read

insert_obj_read_seq

public static void insert_obj_read_seq(org.omg.CORBA.Any any,
                                       org.omg.CORBA.portable.InputStream input,
                                       org.omg.CORBA.TypeCode seq_tc)
similar to insert_obj_read, just that the object read from the input stream is a sequence (array) of elements whose typecode is given as parameter

write_obj_extract

public static void write_obj_extract(org.omg.CORBA.Any any,
                                     org.omg.CORBA.portable.OutputStream os)
Parameters:
any - the Any object that contains the object that has to be written to the output stream os the output stream where the content of the Any is written

write_obj_extract_seq

public static void write_obj_extract_seq(org.omg.CORBA.Any any,
                                         org.omg.CORBA.portable.OutputStream os,
                                         org.omg.CORBA.TypeCode seq_tc)
Method similar to write_obj_extract, but the content of the Any object is a sequence of elementa´s whose typecode is given as a parameter (seq_tc)

extract_obj_from_any

public static java.lang.Object extract_obj_from_any(org.omg.CORBA.Any any)
Parameters:
any - the Any from where the complex structure object is extracted
Returns:
the Object corresponding to the content of the Any

holder_with_value

public static java.lang.Object holder_with_value(org.omg.CORBA.Any any,
                                                 boolean typecode_only)
Method used to return an object corresponding to an instance of the Holder class of the object contained by the Any; the instance of the holder class will contain as value the content of the Any

invoke_helper_method

public static void invoke_helper_method(java.lang.String oper,
                                        java.lang.String class_n,
                                        java.lang.Object[] params)
Method used to invoke the operation oper from the helper class of the class with name class_n, with parameters params

narrow

public static java.lang.Object narrow(org.omg.CORBA.Object obj,
                                      java.lang.String type_id)
Method used to call the narrow method of the helper class of the type identifier type_id, with the obj as parameter

is_read_method

public static boolean is_read_method(java.lang.String mn,
                                     MethStr[] method_table)
Method used to check whether a certain method of the server is read-only or update (using the method signature table)

method_type

public static char method_type(java.lang.String mn,
                               MethSignStr[] method_table)
Method used to return the type of a server method

method_structure

public static MethSignStr method_structure(java.lang.String mn,
                                           MethSignStr[] method_table)
Method used to return the method signature for the method with name mn

parse_constraint_expr

public static org.omg.CosNotification.Property[] parse_constraint_expr(java.lang.String constraint_expr)
Method used to extract properties used in filtering events, from aconsraint expression given as parameter

pass_filter

public static boolean pass_filter(org.omg.CosNotification.StructuredEvent e,
                                  org.omg.CosNotifyFilter.Filter f)
Method called to decide whether an event (StructuredEvent) has to be sent or not to a certain consumer, based on the filter information (what events it is interested in) provided about that consumer

include

private static boolean include(org.omg.CosNotification.Property[] a,
                               org.omg.CosNotification.Property[] b)
Method used to determine whether one set is a subset of another (sets are expressed as CosNotification.Property arrays)

readlongObject

public static long[] readlongObject(java.io.ObjectInputStream ois)
Method used to read an array of long from an Object Input Stream

writelongObject

public static void writelongObject(java.io.ObjectOutputStream oos,
                                   long[] obj)
Method used to write an array of long to an Object Output Stream

parse_ft_dom_file_i

public static Utils.FTDomInfo[] parse_ft_dom_file_i(java.lang.String file_name)
Method used to read the host names form the FT domain from the file with name file_name

parse_ft_dom_file

public static java.lang.String[] parse_ft_dom_file(java.lang.String ft_dom_name)
Method used to parse the file where the host names from the FT domain are and return their list where the filename is hard coded

trace

public static void trace(java.lang.String message,
                         java.io.RandomAccessFile raf)
Method used to write a message in a file

trace

public static void trace(int moment_code,
                         int retention_id,
                         java.lang.String client_id,
                         long time,
                         java.lang.String oper_name,
                         java.io.RandomAccessFile raf)
Method used to record time traces for measurement purposes
Parameters:
moment_code - identifies the moment when the trace was taken (e.g. when the replication manager finished some recovery action) retention_id the retention identifier of the request for which the trace was taken client_id the client identifier of the request for which the trace was taken time time in milliseconds when the trace was taken oper_name the operation (method) name for which the trace was done raf the file where to write the trace info

trace

public static void trace(int which_replica,
                         int moment_code,
                         int retention_id,
                         java.lang.String client_id,
                         long time,
                         java.lang.String oper_name,
                         java.io.RandomAccessFile raf)
Method used to record time traces for measurement purposes in active replication
Parameters:
which_replica - the index of the replica of the active group that traced the information moment_code identifies the moment when the trace was taken (e.g. when the replication manager finished some recovery action) retention_id the retention identifier of the request for which the trace was taken client_id the client identifier of the request for which the trace was taken time time in milliseconds when the trace was taken oper_name the operation (method) name for which the trace was done raf the file where to write the trace info

trace

public static void trace(int moment_code,
                         int size,
                         long time,
                         long obj_id,
                         java.io.RandomAccessFile raf)
Method used to record time traces for measurement purposes
Parameters:
moment_code - identifies the moment when the trace was taken (e.g. when the replication manager finished reading some state) size size of the state time time in milliseconds when the trace was taken obj_id the object identifier of the group for which the trace was taken raf the file where to write the trace info

trace

public static void trace(int moment_code,
                         long group_id,
                         int nr_of_repl,
                         int replication_s,
                         long time,
                         java.io.RandomAccessFile raf)
Method used to record time traces for measurement purposes
Parameters:
moment_code - identifies the moment when the trace was taken (e.g. when the replication manager finished some recovery action) group_id the object identifier of the group for which the trace was taken nr_of_repl number of replicas in the group when the trace was taken replication_s the replication_style time time in milliseconds when the trace was taken raf the file where to write the trace info

exec_meth

private static void exec_meth(java.lang.Object obj,
                              long o_i,
                              LogRecord[] last_req,
                              LoggingRecoveryController cb,
                              MethSignStr[] method_sign,
                              org.omg.CORBA.ORB orb)
Method used in replay_last_requests to replay the logged methods on the recoverin bakup

replay_last_requests

public static void replay_last_requests(java.lang.Object the_obj,
                                        long obj_id,
                                        LogRecord[] last_requests,
                                        LogRecord[] last_requests_nr,
                                        LoggingRecoveryController callback,
                                        int retention_id,
                                        org.openorb.CORBA.ORB orb,
                                        MethSignStr[] methods)
Method called when at failver requests have to be replayed on the recovering backup (in passive replication)
Parameters:
the_obj - Object on which the methods are replayed obj_id the identifier of the object group whose member the_obj is last_requests the list ofrequests that have to be replayed on the backup last_requests_nr the list of requests to be replayed for which no reply was recorded in the primary callback the logging and recovery CORBA object retention_id the retention identifier of the last outgoing CORBA request (if any) from the primary orb the ORB in which the method calling object is running methods the table of method signatures of the CORBA object on which the requests will be replayed

prune_outcome_vector

public static void prune_outcome_vector(java.util.Vector reg,
                                        int k)
Method used in the FA-CORBA infrastructure when the outcome register of a witness has to be reduced, by removing the update records since the last state record, and replace them by one state record
Parameters:
reg - the vector representing the register of the witness k the position in the total order of requests of the request that was processed before sending the state

elementAt

public static universal.Outcome elementAt(java.util.Vector reg,
                                          int k)
Method that returns the element in the Outcome vector (used in FA-CORBA infrastructure) that corresponds to an update that happened after k number of requests processed Since the number of records in the vector is not the sane as the requests processed, in order to return the element "k", it is not possible to return the element on position k, but the element for which the field after_n_req is k