1 3 package org.jgroups; 4 5 import org.apache.commons.logging.Log; 6 import org.apache.commons.logging.LogFactory; 7 import org.jgroups.conf.ConfiguratorFactory; 8 import org.jgroups.conf.ProtocolStackConfigurator; 9 import org.jgroups.stack.ProtocolStack; 10 import org.jgroups.stack.StateTransferInfo; 11 import org.jgroups.util.*; 12 import org.w3c.dom.Element ; 13 14 import java.io.File ; 15 import java.io.Serializable ; 16 import java.net.URL ; 17 import java.util.HashMap ; 18 import java.util.Map ; 19 import java.util.Vector ; 20 21 29 public class JChannel extends Channel { 30 31 34 public static final String DEFAULT_PROTOCOL_STACK= 35 "UDP(mcast_addr=228.1.2.3;mcast_port=45566;ip_ttl=32):" + 36 "PING(timeout=3000;num_initial_members=6):" + 37 "FD(timeout=3000):" + 38 "VERIFY_SUSPECT(timeout=1500):" + 39 "pbcast.NAKACK(gc_lag=10;retransmit_timeout=600,1200,2400,4800):" + 40 "UNICAST(timeout=600,1200,2400,4800):" + 41 "pbcast.STABLE(desired_avg_gossip=10000):" + 42 "FRAG:" + 43 "pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;" + 44 "shun=true;print_local_addr=true)"; 45 46 static final String FORCE_PROPS="force.properties"; 47 48 49 private String props=null; 50 51 52 private Address local_addr=null; 53 54 private String channel_name=null; 56 private View my_view=null; 57 58 private final Queue mq=new Queue(); 59 60 private ProtocolStack prot_stack=null; 61 62 63 protected CloserThread closer=null; 64 65 66 private final Promise local_addr_promise=new Promise(); 67 68 69 private final Promise connect_promise=new Promise(); 70 71 72 private final Promise disconnect_promise=new Promise(); 73 74 private final Promise state_promise=new Promise(); 75 76 79 80 private long LOCAL_ADDR_TIMEOUT=30000; 82 private static final long GET_STATE_DEFAULT_TIMEOUT=5000; 83 84 private boolean receive_views=true; 85 86 private boolean receive_suspects=true; 87 88 private boolean receive_blocks=false; 89 91 private boolean receive_local_msgs=true; 92 93 private boolean receive_get_states=false; 94 95 private boolean auto_reconnect=false; 96 98 private boolean auto_getstate=false; 99 100 private boolean connected=false; 101 102 103 private final CondVar block_sending=new CondVar("block_sending", Boolean.FALSE); 104 105 106 private boolean closed=false; 108 109 private boolean state_transfer_supported=false; 111 114 private byte[] additional_data=null; 115 116 protected final Log log=LogFactory.getLog(getClass()); 117 118 125 public JChannel() throws ChannelException { 126 this(DEFAULT_PROTOCOL_STACK); 127 } 128 129 139 public JChannel(File properties) throws ChannelException { 140 this(ConfiguratorFactory.getStackConfigurator(properties)); 141 } 142 143 153 public JChannel(Element properties) throws ChannelException { 154 this(ConfiguratorFactory.getStackConfigurator(properties)); 155 } 156 157 167 public JChannel(URL properties) throws ChannelException { 168 this(ConfiguratorFactory.getStackConfigurator(properties)); 169 } 170 171 184 public JChannel(String properties) throws ChannelException { 185 this(ConfiguratorFactory.getStackConfigurator(properties)); 186 } 187 188 201 protected JChannel(ProtocolStackConfigurator configurator) throws ChannelException { 202 props = configurator.getProtocolStackString(); 203 204 205 prot_stack=new ProtocolStack(this, props); 206 207 208 try { 209 prot_stack.setup(); 210 } 211 catch(Throwable e) { 212 throw new ChannelException("unable to setup the protocol stack", e); 213 } 214 } 215 216 229 public JChannel(Object properties) throws ChannelException { 230 if (properties == null) { 231 properties = DEFAULT_PROTOCOL_STACK; 232 } 233 234 try { 235 ProtocolStackConfigurator c=ConfiguratorFactory.getStackConfigurator(properties); 236 props=c.getProtocolStackString(); 237 } 238 catch(Exception x) { 239 String strace=Util.getStackTrace(x); 240 if(log.isErrorEnabled()) log.error(strace); 241 throw new ChannelException("unable to load protocol stack: {" + x.getMessage() + ';' + strace + '}'); 242 } 243 244 245 prot_stack=new ProtocolStack(this, props); 246 247 248 try { 249 prot_stack.setup(); 250 } 251 catch(Throwable e) { 252 throw new ChannelException("JChannel(): " + e); 253 } 254 } 255 256 257 263 public ProtocolStack getProtocolStack() { 264 return prot_stack; 265 } 266 267 268 273 public String getProperties() { 274 return props; 275 } 276 277 278 282 public String printProtocolSpec(boolean include_properties) { 283 return prot_stack != null ? prot_stack.printProtocolSpec(include_properties) : null; 284 } 285 286 287 301 public synchronized void connect(String channel_name) throws ChannelException, ChannelClosedException { 302 303 checkClosed(); 304 305 306 if(connected) { 307 if(log.isErrorEnabled()) log.error("already connected to " + channel_name); 308 return; 309 } 310 311 312 if(channel_name == null) { 313 if(log.isInfoEnabled()) log.info("channel_name is null, assuming unicast channel"); 314 } 315 else 316 this.channel_name=channel_name; 317 318 try { 319 prot_stack.startStack(); } 321 catch(Throwable e) { 322 if(log.isErrorEnabled()) log.error("exception: " + e); 323 throw new ChannelException(e.toString()); 324 } 325 326 327 try { 328 LOCAL_ADDR_TIMEOUT=Long.parseLong(System.getProperty("local_addr.timeout","30000")); 329 } 330 catch (SecurityException e1) { 331 332 } 333 334 335 local_addr=(Address)local_addr_promise.getResult(LOCAL_ADDR_TIMEOUT); 336 if(local_addr == null) { 337 log.fatal("local_addr is null; cannot connect"); 338 throw new ChannelException("local_addr is null"); 339 } 340 341 342 344 Vector t=new Vector (1); 345 t.addElement(local_addr); 346 my_view=new View(local_addr, 0, t); 348 if(channel_name != null) { 350 connect_promise.reset(); 351 Event connect_event=new Event(Event.CONNECT, channel_name); 352 down(connect_event); 353 connect_promise.getResult(); } 355 356 357 connected=true; 358 if(channel_listener != null) 359 channel_listener.channelConnected(this); 360 } 361 362 363 374 public synchronized void disconnect() { 375 if(closed) return; 376 377 if(connected) { 378 379 if(channel_name != null) { 380 381 385 Event disconnect_event=new Event(Event.DISCONNECT, local_addr); 386 disconnect_promise.reset(); 387 down(disconnect_event); disconnect_promise.getResult(); } 390 391 down(new Event(Event.STOP_QUEUEING)); 393 394 connected=false; 395 try { 396 prot_stack.stopStack(); } 398 catch(Exception e) { 399 if(log.isErrorEnabled()) log.error("exception: " + e); 400 } 401 402 if(channel_listener != null) 403 channel_listener.channelDisconnected(this); 404 405 init(); } 407 } 408 409 410 415 public synchronized void close() { 416 _close(true, true); } 418 419 420 427 public synchronized void open() throws ChannelException { 428 if(!closed) 429 throw new ChannelException("JChannel.open(): channel is already open"); 430 431 try { 432 mq.reset(); 433 434 prot_stack=new ProtocolStack(this, props); 436 prot_stack.setup(); 437 closed=false; 438 } 439 catch(Exception e) { 440 throw new ChannelException("JChannel().open(): " + e.getMessage()); 441 } 442 } 443 444 447 public boolean isOpen() { 448 return !closed; 449 } 450 451 452 455 public boolean isConnected() { 456 return connected; 457 } 458 459 public int getNumMessages() { 460 return mq != null? mq.size() : -1; 461 } 462 463 464 472 public void send(Message msg) throws ChannelNotConnectedException, ChannelClosedException { 473 checkClosed(); 474 checkNotConnected(); 475 down(new Event(Event.MSG, msg)); 476 } 477 478 479 489 public void send(Address dst, Address src, Serializable obj) throws ChannelNotConnectedException, ChannelClosedException { 490 send(new Message(dst, src, obj)); 491 } 492 493 494 508 public Object receive(long timeout) throws ChannelNotConnectedException, ChannelClosedException, TimeoutException { 509 Object retval=null; 510 Event evt; 511 512 checkClosed(); 513 checkNotConnected(); 514 515 try { 516 evt=(timeout <= 0) ? (Event)mq.remove() : (Event)mq.remove(timeout); 517 retval=getEvent(evt); 518 evt=null; 519 return retval; 520 } 521 catch(QueueClosedException queue_closed) { 522 throw new ChannelClosedException(); 523 } 524 catch(TimeoutException t) { 525 throw t; 526 } 527 catch(Exception e) { 528 if(log.isErrorEnabled()) log.error("exception: " + e); 529 return null; 530 } 531 } 532 533 534 540 public Object peek(long timeout) throws ChannelNotConnectedException, ChannelClosedException, TimeoutException { 541 Object retval=null; 542 Event evt; 543 544 checkClosed(); 545 checkNotConnected(); 546 547 try { 548 evt=(timeout <= 0) ? (Event)mq.peek() : (Event)mq.peek(timeout); 549 retval=getEvent(evt); 550 evt=null; 551 return retval; 552 } 553 catch(QueueClosedException queue_closed) { 554 if(log.isErrorEnabled()) log.error("exception: " + queue_closed); 555 return null; 556 } 557 catch(TimeoutException t) { 558 return null; 559 } 560 catch(Exception e) { 561 if(log.isErrorEnabled()) log.error("exception: " + e); 562 return null; 563 } 564 } 565 566 567 568 569 574 public View getView() { 575 return closed || !connected ? null : my_view; 576 } 577 578 579 583 public Address getLocalAddress() { 584 return closed ? null : local_addr; 585 } 586 587 588 592 public String getChannelName() { 593 return closed ? null : !connected ? null : channel_name; 594 } 595 596 597 643 public void setOpt(int option, Object value) { 644 if(closed) { 645 if(log.isWarnEnabled()) log.warn("channel is closed; option not set !"); 646 return; 647 } 648 649 switch(option) { 650 case VIEW: 651 if(value instanceof Boolean ) 652 receive_views=((Boolean )value).booleanValue(); 653 else 654 if(log.isErrorEnabled()) log.error("option " + Channel.option2String(option) + 655 " (" + value + "): value has to be Boolean"); 656 break; 657 case SUSPECT: 658 if(value instanceof Boolean ) 659 receive_suspects=((Boolean )value).booleanValue(); 660 else 661 if(log.isErrorEnabled()) log.error("option " + Channel.option2String(option) + 662 " (" + value + "): value has to be Boolean"); 663 break; 664 case BLOCK: 665 if(value instanceof Boolean ) 666 receive_blocks=((Boolean )value).booleanValue(); 667 else 668 if(log.isErrorEnabled()) log.error("option " + Channel.option2String(option) + 669 " (" + value + "): value has to be Boolean"); 670 if(receive_blocks) 671 receive_views=true; 672 break; 673 674 case GET_STATE_EVENTS: 675 if(value instanceof Boolean ) 676 receive_get_states=((Boolean )value).booleanValue(); 677 else 678 if(log.isErrorEnabled()) log.error("option " + Channel.option2String(option) + 679 " (" + value + "): value has to be Boolean"); 680 break; 681 682 683 case LOCAL: 684 if(value instanceof Boolean ) 685 receive_local_msgs=((Boolean )value).booleanValue(); 686 else 687 if(log.isErrorEnabled()) log.error("option " + Channel.option2String(option) + 688 " (" + value + "): value has to be Boolean"); 689 break; 690 691 case AUTO_RECONNECT: 692 if(value instanceof Boolean ) 693 auto_reconnect=((Boolean )value).booleanValue(); 694 else 695 if(log.isErrorEnabled()) log.error("option " + Channel.option2String(option) + 696 " (" + value + "): value has to be Boolean"); 697 break; 698 699 case AUTO_GETSTATE: 700 if(value instanceof Boolean ) { 701 auto_getstate=((Boolean )value).booleanValue(); 702 if(auto_getstate) 703 auto_reconnect=true; 704 } 705 else 706 if(log.isErrorEnabled()) log.error("option " + Channel.option2String(option) + 707 " (" + value + "): value has to be Boolean"); 708 break; 709 710 default: 711 if(log.isErrorEnabled()) log.error("option " + Channel.option2String(option) + " not known"); 712 break; 713 } 714 } 715 716 717 723 public Object getOpt(int option) { 724 switch(option) { 725 case VIEW: 726 return receive_views ? Boolean.TRUE : Boolean.FALSE; 728 case BLOCK: 729 return receive_blocks ? Boolean.TRUE : Boolean.FALSE; 731 case SUSPECT: 732 return receive_suspects ? Boolean.TRUE : Boolean.FALSE; 734 case GET_STATE_EVENTS: 735 return receive_get_states ? Boolean.TRUE : Boolean.FALSE; 737 case LOCAL: 738 return receive_local_msgs ? Boolean.TRUE : Boolean.FALSE; 740 default: 741 if(log.isErrorEnabled()) log.error("option " + Channel.option2String(option) + " not known"); 742 return null; 743 } 744 } 745 746 747 753 public void blockOk() { 754 down(new Event(Event.BLOCK_OK)); 755 down(new Event(Event.START_QUEUEING)); 756 } 757 758 759 767 public boolean getState(Address target, long timeout) throws ChannelNotConnectedException, ChannelClosedException { 768 StateTransferInfo info=new StateTransferInfo(StateTransferInfo.GET_FROM_SINGLE, target); 769 info.timeout=timeout; 770 return _getState(new Event(Event.GET_STATE, info), timeout); 771 } 772 773 774 782 public boolean getAllStates(Vector targets, long timeout) throws ChannelNotConnectedException, ChannelClosedException { 783 StateTransferInfo info=new StateTransferInfo(StateTransferInfo.GET_FROM_MANY, targets); 784 return _getState(new Event(Event.GET_STATE, info), timeout); 785 } 786 787 788 796 public void returnState(byte[] state) { 797 down(new Event(Event.GET_APPLSTATE_OK, state)); 798 } 799 800 801 802 803 804 811 public void up(Event evt) { 812 int type=evt.getType(); 813 Message msg; 814 815 817 if(mq == null) { 818 if(log.isErrorEnabled()) log.error("message queue is null"); 819 return; 820 } 821 822 switch(type) { 823 824 case Event.MSG: 825 msg=(Message)evt.getArg(); 826 if(!receive_local_msgs) { if(local_addr != null && msg.getSrc() != null) 828 if(local_addr.equals(msg.getSrc())) 829 return; 830 } 831 break; 832 833 case Event.VIEW_CHANGE: 834 my_view=(View)evt.getArg(); 835 836 if(connected == false) { 839 connected=true; 840 connect_promise.setResult(Boolean.TRUE); 841 } 842 843 down(new Event(Event.STOP_QUEUEING)); 845 if(!receive_views) return; 847 break; 850 851 case Event.SUSPECT: 852 if(!receive_suspects) 853 return; 854 break; 855 856 case Event.GET_APPLSTATE: if(!receive_get_states) { down(new Event(Event.GET_APPLSTATE_OK, null)); 859 return; 860 } 861 break; 862 863 case Event.CONFIG: 864 HashMap config=(HashMap )evt.getArg(); 865 if(config != null && config.containsKey("state_transfer")) 866 state_transfer_supported=((Boolean )config.get("state_transfer")).booleanValue(); 867 break; 868 869 case Event.BLOCK: 870 875 if(!receive_blocks) { down(new Event(Event.BLOCK_OK)); 877 down(new Event(Event.START_QUEUEING)); 878 return; 879 } 880 break; 881 882 case Event.CONNECT_OK: 883 connect_promise.setResult(Boolean.TRUE); 884 break; 885 886 case Event.DISCONNECT_OK: 887 disconnect_promise.setResult(Boolean.TRUE); 888 break; 889 890 case Event.GET_STATE_OK: 891 try { 892 mq.add(new Event(Event.STATE_RECEIVED, evt.getArg())); 893 } 894 catch(Exception e) { 895 } 896 state_promise.setResult(evt.getArg()); 897 break; 898 899 case Event.SET_LOCAL_ADDRESS: 900 local_addr_promise.setResult(evt.getArg()); 901 break; 902 903 case Event.EXIT: 904 handleExit(evt); 905 return; 907 case Event.BLOCK_SEND: if(log.isInfoEnabled()) log.info("received BLOCK_SEND"); 909 block_sending.set(Boolean.TRUE); 910 break; 911 912 case Event.UNBLOCK_SEND: if(log.isInfoEnabled()) log.info("received UNBLOCK_SEND"); 914 block_sending.set(Boolean.FALSE); 915 break; 916 917 default: 918 break; 919 } 920 921 922 if(up_handler != null) { 924 up_handler.up(evt); 925 return; 926 } 927 928 if(type == Event.MSG || type == Event.VIEW_CHANGE || type == Event.SUSPECT || 929 type == Event.GET_APPLSTATE || type == Event.BLOCK) { 930 try { 931 mq.add(evt); 932 } 933 catch(Exception e) { 934 if(log.isErrorEnabled()) log.error("exception: " + e); 935 } 936 } 937 } 938 939 940 944 public void down(Event evt) { 945 if(evt == null) return; 946 947 if(evt.getType() == Event.MSG && block_sending.get().equals(Boolean.TRUE)) { 951 if(log.isTraceEnabled()) log.trace("down() blocks because block_sending == true"); 952 block_sending.waitUntil(Boolean.FALSE); 953 } 954 955 if(evt.getType() == Event.CONFIG) { 957 try { 958 Map m=(Map )evt.getArg(); 959 if(m != null && m.containsKey("additional_data")) { 960 additional_data=(byte[])m.get("additional_data"); 961 } 962 } 963 catch(Throwable t) { 964 if(log.isErrorEnabled()) log.error("CONFIG event did not contain a hashmap: " + t); 965 } 966 } 967 968 if(prot_stack != null) 969 prot_stack.down(evt); 970 else 971 if(log.isErrorEnabled()) log.error("no protocol stack available"); 972 } 973 974 975 public String toString(boolean details) { 976 StringBuffer sb=new StringBuffer (); 977 sb.append("local_addr=").append(local_addr).append('\n'); 978 sb.append("channel_name=").append(channel_name).append('\n'); 979 sb.append("my_view=").append(my_view).append('\n'); 980 sb.append("connected=").append(connected).append('\n'); 981 sb.append("closed=").append(closed).append('\n'); 982 if(mq != null) 983 sb.append("incoming queue size=").append(mq.size()).append('\n'); 984 if(details) { 985 sb.append("block_sending=").append(block_sending).append('\n'); 986 sb.append("receive_views=").append(receive_views).append('\n'); 987 sb.append("receive_suspects=").append(receive_suspects).append('\n'); 988 sb.append("receive_blocks=").append(receive_blocks).append('\n'); 989 sb.append("receive_local_msgs=").append(receive_local_msgs).append('\n'); 990 sb.append("receive_get_states=").append(receive_get_states).append('\n'); 991 sb.append("auto_reconnect=").append(auto_reconnect).append('\n'); 992 sb.append("auto_getstate=").append(auto_getstate).append('\n'); 993 sb.append("state_transfer_supported=").append(state_transfer_supported).append('\n'); 994 sb.append("props=").append(props).append('\n'); 995 } 996 997 return sb.toString(); 998 } 999 1000 1001 1002 1003 1004 1008 private void init() { 1009 local_addr=null; 1010 channel_name=null; 1011 my_view=null; 1012 1013 1017 connect_promise.reset(); 1018 disconnect_promise.reset(); 1019 connected=false; 1020 block_sending.set(Boolean.FALSE); 1021 } 1022 1023 1024 1028 private final void checkNotConnected() throws ChannelNotConnectedException { 1029 if(!connected) 1030 throw new ChannelNotConnectedException(); 1031 } 1032 1033 1037 private final void checkClosed() throws ChannelClosedException { 1038 if(closed) 1039 throw new ChannelClosedException(); 1040 } 1041 1042 1061 static Object getEvent(Event evt) { 1062 if(evt == null) 1063 return null; 1065 switch(evt.getType()) { 1066 case Event.MSG: 1067 return evt.getArg(); 1068 case Event.VIEW_CHANGE: 1069 return evt.getArg(); 1070 case Event.SUSPECT: 1071 return new SuspectEvent(evt.getArg()); 1072 case Event.BLOCK: 1073 return new BlockEvent(); 1074 case Event.GET_APPLSTATE: 1075 return new GetStateEvent(evt.getArg()); 1076 case Event.STATE_RECEIVED: 1077 return new SetStateEvent((byte[])evt.getArg()); 1078 case Event.EXIT: 1079 return new ExitEvent(); 1080 default: 1081 return evt; 1082 } 1083 } 1084 1085 1086 1094 boolean _getState(Event evt, long timeout) throws ChannelNotConnectedException, ChannelClosedException { 1095 checkClosed(); 1096 checkNotConnected(); 1097 if(!state_transfer_supported) { 1098 log.error("fetching state will fail as state transfer is not supported. " 1099 + "Add one of the STATE_TRANSFER protocols to your protocol configuration"); 1100 return false; 1101 } 1102 1103 state_promise.reset(); 1104 down(evt); 1105 byte[] state=(byte[])state_promise.getResult(timeout); 1106 if(state != null) return true; 1108 else 1109 return false; 1110 } 1111 1112 1113 1123 void _close(boolean disconnect, boolean close_mq) { 1124 if(closed) 1125 return; 1126 1127 if(disconnect) 1128 disconnect(); 1130 if(close_mq) { 1131 try { 1132 if(mq != null) 1133 mq.close(false); } 1135 catch(Exception e) { 1136 if(log.isErrorEnabled()) log.error("exception: " + e); 1137 } 1138 } 1139 1140 if(prot_stack != null) { 1141 try { 1142 prot_stack.stopStack(); 1143 prot_stack.destroy(); 1144 } 1145 catch(Exception e) { 1146 if(log.isErrorEnabled()) log.error("exception: " + e); 1147 } 1148 } 1149 closed=true; 1150 connected=false; 1151 if(channel_listener != null) 1152 channel_listener.channelClosed(this); 1153 init(); } 1155 1156 1157 1163 void handleExit(Event evt) { 1164 if(channel_listener != null) 1165 channel_listener.channelShunned(); 1166 1167 if(closer != null && !closer.isAlive()) 1168 closer=null; 1169 if(closer == null) { 1170 if(log.isInfoEnabled()) 1171 log.info("received an EXIT event, will leave the channel"); 1172 closer=new CloserThread(evt); 1173 closer.start(); 1174 } 1175 } 1176 1177 1178 1179 1180 class CloserThread extends Thread { 1181 final Event evt; 1182 final Thread t=null; 1183 1184 1185 CloserThread(Event evt) { 1186 this.evt=evt; 1187 setName("CloserThread"); 1188 setDaemon(true); 1189 } 1190 1191 1192 public void run() { 1193 try { 1194 String old_channel_name=channel_name; if(log.isInfoEnabled()) 1196 log.info("closing the channel"); 1197 _close(false, false); 1199 if(up_handler != null) 1200 up_handler.up(this.evt); 1201 else { 1202 try { 1203 mq.add(this.evt); 1204 } 1205 catch(Exception ex) { 1206 if(log.isErrorEnabled()) log.error("exception: " + ex); 1207 } 1208 } 1209 1210 if(mq != null) { 1211 Util.sleep(500); try { 1213 mq.close(false); 1214 } 1215 catch(Exception ex) { 1216 } 1217 } 1218 1219 if(auto_reconnect) { 1220 try { 1221 if(log.isInfoEnabled()) log.info("reconnecting to group " + old_channel_name); 1222 open(); 1223 } 1224 catch(Exception ex) { 1225 if(log.isErrorEnabled()) log.error("failure reopening channel: " + ex); 1226 return; 1227 } 1228 try { 1229 if(additional_data != null) { 1230 Map m=new HashMap (11); 1232 m.put("additional_data", additional_data); 1233 down(new Event(Event.CONFIG, m)); 1234 } 1235 connect(old_channel_name); 1236 if(channel_listener != null) 1237 channel_listener.channelReconnected(local_addr); 1238 } 1239 catch(Exception ex) { 1240 if(log.isErrorEnabled()) log.error("failure reconnecting to channel: " + ex); 1241 return; 1242 } 1243 } 1244 1245 if(auto_getstate) { 1246 if(log.isInfoEnabled()) 1247 log.info("fetching the state (auto_getstate=true)"); 1248 boolean rc=JChannel.this.getState(null, GET_STATE_DEFAULT_TIMEOUT); 1249 if(rc) 1250 if(log.isInfoEnabled()) log.info("state was retrieved successfully"); 1251 else 1252 if(log.isInfoEnabled()) log.info("state transfer failed"); 1253 } 1254 1255 } 1256 catch(Exception ex) { 1257 if(log.isErrorEnabled()) log.error("exception: " + ex); 1258 } 1259 finally { 1260 closer=null; 1261 } 1262 } 1263 } 1264 1265} 1266 | Popular Tags |