Compare commits

..

No commits in common. "5be25735ae773760172609315819001beb85d20d" and "7bbfeea23a6ad8b2fe8a4863020243e2c0d56af2" have entirely different histories.

9 changed files with 9 additions and 18 deletions

View file

@ -2,9 +2,9 @@
<classpath> <classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry exported="true" kind="lib" path="jose4j-0.9.6.jar"/> <classpathentry exported="true" kind="lib" path="jose4j-0.9.3.jar"/>
<classpathentry exported="true" kind="lib" path="password4j-1.8.1.jar"/> <classpathentry exported="true" kind="lib" path="password4j-1.6.3.jar"/>
<classpathentry exported="true" kind="lib" path="slf4j-api-2.0.12.jar"/> <classpathentry exported="true" kind="lib" path="slf4j-api-2.0.6.jar"/>
<classpathentry exported="true" kind="lib" path="PeerAtCodeParser.jar"/> <classpathentry exported="true" kind="lib" path="C:/Users/jeffc/eclipse-workspace/peer-at-code-framework/PeerAtCodeParser.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

BIN
password4j-1.6.3.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
slf4j-api-2.0.6.jar Normal file

Binary file not shown.

View file

@ -29,17 +29,14 @@ public class Client<U extends User> extends Thread{
writer.flush(); writer.flush();
writer.close(); writer.close();
}catch(InvalidJwtException e){ }catch(InvalidJwtException e){
this.router.getExceptionLogger().setValue(e);
}catch(Exception e){ }catch(Exception e){
this.router.getExceptionLogger().setValue(e); e.printStackTrace();
if(context != null && context.getResponseCode() == 0){ if(context != null && context.getResponseCode() == 0){
try{ try{
context.response(500); context.response(500);
writer.flush(); writer.flush();
writer.close(); writer.close();
}catch(Exception ex){ }catch(Exception ex){}
this.router.getExceptionLogger().setValue(ex);
}
} }
} }
if(context != null) router.getLogger().setValue(context); if(context != null) router.getLogger().setValue(context);
@ -56,9 +53,7 @@ public class Client<U extends User> extends Thread{
writer.response(401, this.router.getDefaultHeaders(type)); writer.response(401, this.router.getDefaultHeaders(type));
writer.flush(); writer.flush();
writer.close(); writer.close();
}catch(Exception ex){ }catch(Exception ex){}
this.router.getExceptionLogger().setValue(ex);
}
throw e; throw e;
} }
} }

View file

@ -8,6 +8,8 @@ import java.util.concurrent.LinkedBlockingQueue;
import java.util.function.Consumer; import java.util.function.Consumer;
import java.util.function.Supplier; import java.util.function.Supplier;
import dev.peerat.framework.Locker.Key;
public class Locker<V>{ public class Locker<V>{
private Map<Key, BlockingQueue<V>> map; private Map<Key, BlockingQueue<V>> map;

View file

@ -30,7 +30,6 @@ public class Router<U extends User>{
} }
private Locker<Context> logger; private Locker<Context> logger;
private Locker<Exception> exceptions;
private RouteMapper<U>[] mappers; private RouteMapper<U>[] mappers;
private List<RouteInterceptor> interceptors; private List<RouteInterceptor> interceptors;
private Response noFileFound; private Response noFileFound;
@ -43,7 +42,6 @@ public class Router<U extends User>{
public Router() throws Exception{ public Router() throws Exception{
this.logger = new Locker<>(); this.logger = new Locker<>();
this.exceptions = new Locker<>();
int types = RequestType.values().length; int types = RequestType.values().length;
this.mappers = new RouteMapper[types]; this.mappers = new RouteMapper[types];
this.interceptors = new ArrayList<>(); this.interceptors = new ArrayList<>();
@ -144,10 +142,6 @@ public class Router<U extends User>{
return this.logger; return this.logger;
} }
public Locker<Exception> getExceptionLogger(){
return this.exceptions;
}
public void listen(int port, boolean ssl) throws Exception{ public void listen(int port, boolean ssl) throws Exception{
if (ssl) { // Not needed with the use of a proxy if (ssl) { // Not needed with the use of a proxy
try { try {