Skip to content

Commit

Permalink
Revert whitespace changes due to smart editor
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnupillai committed Sep 24, 2014
1 parent 270de5b commit 7b65d23
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions jpos/src/main/java/org/jpos/util/DirPoll.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* scanning for incoming requests (of varying priorities)
* on the request directory and processing them by means of
* DirPoll.Processor or DirPoll.FileProcessor
*
*
* @author <a href="mailto:[email protected]">Alejandro P. Revilla</a>
* @author <a href="mailto:[email protected]">Matthew Milliss</a>
* @since jPOS 1.2.7
Expand Down Expand Up @@ -233,7 +233,7 @@ public synchronized void setThreadPool (ThreadPool pool) {
//--------------------------------------- FilenameFilter implementation
public boolean accept(File dir, String name) {
boolean result;
String ext = currentPriority >= 0 ?
String ext = currentPriority >= 0 ?
((String) prio.elementAt(currentPriority)) : null;
if (ext != null) {
if (isRegexPriorityMatching()) {
Expand All @@ -254,7 +254,7 @@ public boolean accept(File dir, String name) {
}
//--------------------------------------------- Runnable implementation

public void run() {
public void run() {
Thread.currentThread().setName ("DirPoll-"+basePath);
if (prio.isEmpty())
addPriority("");
Expand Down Expand Up @@ -327,7 +327,7 @@ private byte[] readRequest (File f) throws IOException {
in.close();
return b;
}
private void writeResponse (String requestName, byte[] b)
private void writeResponse (String requestName, byte[] b)
throws IOException
{
if (responseSuffix != null) {
Expand Down Expand Up @@ -366,7 +366,7 @@ private void compress(File f) throws IOException {
}

protected File scan() {
for (currentPriority=0;
for (currentPriority=0;
currentPriority < prio.size(); currentPriority++)
{
String files[] = requestDir.list(this);
Expand All @@ -389,7 +389,7 @@ public interface Processor {
* @param request request image
* @return response (or null)
*/
public byte[] process(String name, byte[] request)
public byte[] process(String name, byte[] request)
throws DirPollException;
}
public interface FileProcessor {
Expand All @@ -407,21 +407,21 @@ public ProcessorRunner (File request) throws IOException {
this.logEvent = null;
}
public void run() {
LogEvent evt =
LogEvent evt =
new LogEvent (
DirPoll.this, "dirpoll", request.getName()
);
try {
if (processor == null)
throw new DirPollException
if (processor == null)
throw new DirPollException
("null processor - nothing to do");
else if (processor instanceof Processor) {
byte[] resp = ((Processor) processor).process (
request.getName(), readRequest (request)
);
if (resp != null)
if (resp != null)
writeResponse (request.getName(), resp);
} else if (processor instanceof FileProcessor)
} else if (processor instanceof FileProcessor)
((FileProcessor) processor).process (request);

if (shouldArchive) {
Expand All @@ -431,8 +431,8 @@ else if (processor instanceof Processor) {
}
} else {
if (!request.delete ())
throw new DirPollException
("error: can't unlink request " + request.getName());
throw new DirPollException
("error: can't unlink request " + request.getName());
}

} catch (Throwable e) {
Expand All @@ -458,7 +458,7 @@ else if (processor instanceof Processor) {
evt.addMessage (_e);
}
} finally {
if (logEvent != null)
if (logEvent != null)
Logger.log (logEvent);
}
}
Expand All @@ -484,7 +484,7 @@ public void setRetry(boolean retry) {
this.retry = retry;
}
}

public void pause() {
synchronized (this) {
if (!paused) {
Expand All @@ -505,7 +505,7 @@ public void unpause() {
}
}
}

public boolean isPaused() {
synchronized (this) {
return paused;
Expand Down

0 comments on commit 7b65d23

Please sign in to comment.