Skip to content

Commit

Permalink
dcap: v. minor tidy up
Browse files Browse the repository at this point in the history
The DCAP door explicitly invokes the flush method after sending each 
reply message; however, PrintWriter has a feature that will do this 
automatically.

This patch enables the auto-flush feature of PrintWriter and removes 
the explicit calls to flush.  It also removes the unused print method 
from DcapDoorInterpreterV3.

Target: trunk
Require-notes: no
Require-book: no
Patch: http://rb.dcache.org/r/5042
Acked-by: Tigran Mkrtchyan
  • Loading branch information
paulmillar committed Dec 17, 2012
1 parent 6c87e89 commit c0edaf9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;

import dmg.cells.nucleus.CellAdapter;
import dmg.cells.nucleus.CellMessage;
Expand Down Expand Up @@ -77,7 +78,7 @@ public DCapDoor( String name , StreamEngine engine , Args args )
_engine = engine;
_reader = engine.getReader();
_in = new BufferedReader( _reader );
_out = new PrintWriter( engine.getWriter() );
_out = new PrintWriter(engine.getWriter(), true);
_subject = engine.getSubject();
_host = engine.getInetAddress().toString();

Expand Down Expand Up @@ -350,8 +351,7 @@ public void cleanUp(){

private synchronized void println( String str ){
_log.info( "toclient(println) : "+str ) ;
_out.println( str );
_out.flush();
_out.println(str);
}

private int execute( VspArgs args ) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,7 @@ private void installVersionRestrictions( String versionString ){
}
public synchronized void println( String str ){
_log.debug("(DCapDoorInterpreterV3) toclient(println) : {}", str);
_out.println( str );
_out.flush();
}

public synchronized void print( String str ){
_log.debug("(DCapDoorInterpreterV3) toclient(print) : {}", str);
_out.print( str );
_out.flush();
_out.println(str);
}

@Override
Expand Down

0 comments on commit c0edaf9

Please sign in to comment.