Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

made private fields and methods protected to enable subclasses to acc…

…ess them
  • Loading branch information...
commit 61872c969ff13137516b44698f77d543c08acaed 1 parent 62e8ce2
Bela Ban authored

Showing 1 changed file with 17 additions and 17 deletions. Show diff stats Hide diff stats

  1. +17 17 src/org/jgroups/protocols/TP.java
34 src/org/jgroups/protocols/TP.java
@@ -54,13 +54,13 @@
54 54 "start_port", "end_port", "use_local_host", "marshaller_pool_size", "num_timer_threads", "timer.num_threads"})
55 55 public abstract class TP extends Protocol {
56 56
57   - private static final byte LIST=1; // we have a list of messages rather than a single message when set
58   - private static final byte MULTICAST=2; // message is a multicast (versus a unicast) message when set
59   - private static final byte OOB=4; // message has OOB flag set (Message.OOB)
  57 + protected static final byte LIST=1; // we have a list of messages rather than a single message when set
  58 + protected static final byte MULTICAST=2; // message is a multicast (versus a unicast) message when set
  59 + protected static final byte OOB=4; // message has OOB flag set (Message.OOB)
60 60
61 61 protected static final boolean can_bind_to_mcast_addr; // are we running on Linux ?
62 62
63   - private static NumberFormat f;
  63 + protected static NumberFormat f;
64 64
65 65 static {
66 66 can_bind_to_mcast_addr=Util.checkForLinux() || Util.checkForSolaris() || Util.checkForHp();
@@ -217,7 +217,7 @@
217 217
218 218 /** Whether or not warnings about messages from different groups are logged - private flag, not for common use */
219 219 @Property(description="whether or not warnings about messages from different groups are logged")
220   - private boolean log_discard_msgs=true;
  220 + protected boolean log_discard_msgs=true;
221 221
222 222
223 223
@@ -448,10 +448,10 @@ public String getTimerClass() {
448 448 // ================================= Default SocketFactory ========================
449 449 protected SocketFactory socket_factory=new DefaultSocketFactory();
450 450
451   - private Bundler bundler=null;
  451 + protected Bundler bundler=null;
452 452
453   - private DiagnosticsHandler diag_handler=null;
454   - private final List<ProbeHandler> preregistered_probe_handlers=new LinkedList<ProbeHandler>();
  453 + protected DiagnosticsHandler diag_handler=null;
  454 + protected final List<ProbeHandler> preregistered_probe_handlers=new LinkedList<ProbeHandler>();
455 455
456 456 /**
457 457 * If singleton_name is enabled, this map is used to de-multiplex incoming messages according to their cluster
@@ -475,7 +475,7 @@ public String getTimerClass() {
475 475
476 476 Future<?> logical_addr_cache_reaper=null;
477 477
478   - private static final LazyRemovalCache.Printable<Address,PhysicalAddress> print_function=new LazyRemovalCache.Printable<Address,PhysicalAddress>() {
  478 + protected static final LazyRemovalCache.Printable<Address,PhysicalAddress> print_function=new LazyRemovalCache.Printable<Address,PhysicalAddress>() {
479 479 public java.lang.String print(final Address logical_addr, final PhysicalAddress physical_addr) {
480 480 StringBuilder sb=new StringBuilder();
481 481 String tmp_logical_name=UUID.get(logical_addr);
@@ -1053,13 +1053,13 @@ public void run() {
1053 1053 * retransmission, when the original sender has crashed, or in a FLUSH protocol when we
1054 1054 * have to return all unstable messages with the FLUSH_OK response.
1055 1055 */
1056   - private void setSourceAddress(Message msg) {
  1056 + protected void setSourceAddress(Message msg) {
1057 1057 if(msg.getSrc() == null && local_addr != null) // should already be set by TP.ProtocolAdapter in shared transport case !
1058 1058 msg.setSrc(local_addr);
1059 1059 }
1060 1060
1061 1061
1062   - private void passMessageUp(Message msg, boolean perform_cluster_name_matching, boolean multicast, boolean discard_own_mcast) {
  1062 + protected void passMessageUp(Message msg, boolean perform_cluster_name_matching, boolean multicast, boolean discard_own_mcast) {
1063 1063 TpHeader hdr=(TpHeader)msg.getHeader(this.id);
1064 1064 if(hdr == null) {
1065 1065 if(log.isErrorEnabled())
@@ -1129,7 +1129,7 @@ protected void receive(Address sender, byte[] data, int offset, int length) {
1129 1129
1130 1130
1131 1131
1132   - private void dispatchToThreadPool(Executor pool, Address sender, byte[] data, int offset, int length) {
  1132 + protected void dispatchToThreadPool(Executor pool, Address sender, byte[] data, int offset, int length) {
1133 1133 if(pool instanceof DirectExecutor) {
1134 1134 // we don't make a copy of the buffer if we execute on this thread
1135 1135 pool.execute(new IncomingPacket(sender, data, offset, length));
@@ -1253,7 +1253,7 @@ protected static Message readMessage(DataInputStream instream) throws Exception
1253 1253 * @param multicast
1254 1254 * @throws Exception
1255 1255 */
1256   - private static void writeMessageList(Address dest, Address src,
  1256 + protected static void writeMessageList(Address dest, Address src,
1257 1257 List<Message> msgs, DataOutputStream dos, boolean multicast) throws Exception {
1258 1258 dos.writeShort(Version.version);
1259 1259
@@ -1279,7 +1279,7 @@ private static void writeMessageList(Address dest, Address src,
1279 1279
1280 1280
1281 1281
1282   - private static List<Message> readMessageList(DataInputStream in) throws Exception {
  1282 + protected static List<Message> readMessageList(DataInputStream in) throws Exception {
1283 1283 List<Message> list=new LinkedList<Message>();
1284 1284 Address dest=Util.readAddress(in);
1285 1285 Address src=Util.readAddress(in);
@@ -1440,7 +1440,7 @@ protected void unsetThreadNames() {
1440 1440 }
1441 1441 }
1442 1442
1443   - private void setInAllThreadFactories(String cluster_name, Address local_address, String pattern) {
  1443 + protected void setInAllThreadFactories(String cluster_name, Address local_address, String pattern) {
1444 1444 ThreadFactory[] factories= {timer_thread_factory,
1445 1445 default_thread_factory,
1446 1446 oob_thread_factory,
@@ -1474,7 +1474,7 @@ protected static ExecutorService createThreadPool(int min_threads, int max_threa
1474 1474 }
1475 1475
1476 1476
1477   - private static void shutdownThreadPool(Executor thread_pool) {
  1477 + protected static void shutdownThreadPool(Executor thread_pool) {
1478 1478 if(thread_pool instanceof ExecutorService) {
1479 1479 ExecutorService service=(ExecutorService)thread_pool;
1480 1480 service.shutdownNow();
@@ -1486,7 +1486,7 @@ private static void shutdownThreadPool(Executor thread_pool) {
1486 1486 }
1487 1487 }
1488 1488
1489   - private void verifyRejectionPolicy(String str) throws Exception{
  1489 + protected void verifyRejectionPolicy(String str) throws Exception{
1490 1490 if(!(str.equalsIgnoreCase("run") || str.equalsIgnoreCase("abort")|| str.equalsIgnoreCase("discard")|| str.equalsIgnoreCase("discardoldest"))) {
1491 1491 log.error("rejection policy of " + str + " is unknown");
1492 1492 throw new Exception("Unknown rejection policy " + str);

0 comments on commit 61872c9

Please sign in to comment.
Something went wrong with that request. Please try again.