-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert whitespace changes due to smart editor
- Loading branch information
vishnupillai
committed
Sep 24, 2014
1 parent
270de5b
commit 7b65d23
Showing
1 changed file
with
16 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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()) { | ||
|
@@ -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(""); | ||
|
@@ -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) { | ||
|
@@ -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); | ||
|
@@ -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 { | ||
|
@@ -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) { | ||
|
@@ -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) { | ||
|
@@ -458,7 +458,7 @@ else if (processor instanceof Processor) { | |
evt.addMessage (_e); | ||
} | ||
} finally { | ||
if (logEvent != null) | ||
if (logEvent != null) | ||
Logger.log (logEvent); | ||
} | ||
} | ||
|
@@ -484,7 +484,7 @@ public void setRetry(boolean retry) { | |
this.retry = retry; | ||
} | ||
} | ||
|
||
public void pause() { | ||
synchronized (this) { | ||
if (!paused) { | ||
|
@@ -505,7 +505,7 @@ public void unpause() { | |
} | ||
} | ||
} | ||
|
||
public boolean isPaused() { | ||
synchronized (this) { | ||
return paused; | ||
|