@Override public void onMessage(String message) { if (inbound != null) { try { inbound.onMessage(SocketIOFrame.TEXT_MESSAGE_TYPE, message); } catch (Throwable e) { Log.warn("Session["+sessionId+"]: Exception thrown by SocketIOInbound.onMessage()", e); } } }
@Override public void onMessage(String message) { if (inbound != null) { try { inbound.onMessage(SocketIOFrame.TEXT_MESSAGE_TYPE, message); } catch (Throwable e) { Log.warn("Session["+sessionId+"]: Exception thrown by SocketIOInbound.onMessage()", e); } } }
public boolean accept(File dir, String name) { try { if (name.endsWith(".xml") && dir.equals(getConfigurationDir().getFile())) { return true; } return false; } catch (IOException e) { Log.warn(e); return false; } } });
protected void writeData(ServletResponse response, String data) throws IOException { try { getIdleCheck().activity(); } catch (Exception e) { Log.warn(e); } response.getOutputStream().print("<script>parent.s._("+ JSON.toString(data) +", document);</script>"); response.flushBuffer(); }
protected void writeData(ServletResponse response, String data) throws IOException { try { getIdleCheck().activity(); } catch (Exception e) { Log.warn(e); } Log.debug("Session["+session.getSessionId()+"]: writeData(START): " + data); ServletOutputStream os = response.getOutputStream(); os.println("Content-Type: text/plain"); os.println(); os.println(data); os.println(boundarySeperator); response.flushBuffer(); Log.debug("Session["+session.getSessionId()+"]: writeData(END): " + data); }
@Override public void onConnect(SessionTransportHandler handler) { if (handler == null) { state = ConnectionState.CLOSED; inbound = null; socketIOSessions.remove(sessionId); } else if (this.handler == null) { this.handler = handler; try { state = ConnectionState.CONNECTED; inbound.onConnect(handler); } catch (Throwable e) { Log.warn("Session["+sessionId+"]: Exception thrown by SocketIOInbound.onConnect()", e); state = ConnectionState.CLOSED; handler.abort(); } } else { handler.abort(); } }
@Override public void onConnect(SessionTransportHandler handler) { if (handler == null) { state = ConnectionState.CLOSED; inbound = null; socketIOSessions.remove(sessionId); } else if (this.handler == null) { this.handler = handler; try { state = ConnectionState.CONNECTED; inbound.onConnect(handler); } catch (Throwable e) { Log.warn("Session["+sessionId+"]: Exception thrown by SocketIOInbound.onConnect()", e); state = ConnectionState.CLOSED; handler.abort(); } } else { handler.abort(); } }
@Override public void onDisconnect(DisconnectReason reason) { Log.debug("Session["+sessionId+"]: onDisconnect: " + reason); clearTimeoutTimer(); clearHeartbeatTimer(); if (inbound != null) { state = ConnectionState.CLOSED; try { inbound.onDisconnect(reason, null); } catch (Throwable e) { Log.warn("Session["+sessionId+"]: Exception thrown by SocketIOInbound.onDisconnect()", e); } inbound = null; } }
@Override public void onDisconnect(DisconnectReason reason) { Log.debug("Session["+sessionId+"]: onDisconnect: " + reason); clearTimeoutTimer(); clearHeartbeatTimer(); if (inbound != null) { state = ConnectionState.CLOSED; try { inbound.onDisconnect(reason, null); } catch (Throwable e) { Log.warn("Session["+sessionId+"]: Exception thrown by SocketIOInbound.onDisconnect()", e); } inbound = null; } }
public void addJars(Resource lib) { if (lib.exists() && lib.isDirectory()) { String[] files=lib.list(); for (int f=0;files!=null && f<files.length;f++) { try { Resource fn=lib.addPath(files[f]); String fnlc=fn.getName().toLowerCase(); if (!fn.isDirectory() && isAndroidArchive(fnlc)) { String jar=fn.getFile().getAbsolutePath(); addClassPath(jar); } } catch (Exception ex) { Log.warn(Log.EXCEPTION,ex); } } } }
@Override public UserIdentity loadUser(String user) { Log.debug("attempting to load user [{}]", user); try { GetResponse response = client.prepareGet(authIndex, authType, user) .setFields(passwordField, rolesField) .execute().actionGet(); if (response.isExists()) { Log.debug("user [{}] exists; looking for credentials...", user); Credential credential = null; GetField passwordGetField = response.getField(passwordField); if (passwordGetField != null) { Log.debug("user [{}] using password auth", user); credential = Credential.getCredential((String) passwordGetField.getValue()); } String[] roles = getStringValues(response.getField(rolesField)); return putUser(user, credential, roles); } } catch (IndexMissingException e) { Log.warn("no auth index [{}]", authIndex); } catch (Exception e) { Log.warn("error finding user [" + user + "] in [" + authIndex + "]", e); } return null; }
protected void doStart() throws Exception { if (_configurationDir == null) { Log.warn("No configuration dir specified"); throw new IllegalStateException("No configuration dir specified");