本文整理汇总了Java中java.rmi.server.ServerNotActiveException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java ServerNotActiveException.printStackTrace方法的具体用法?Java ServerNotActiveException.printStackTrace怎么用?Java ServerNotActiveException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.rmi.server.ServerNotActiveException
的用法示例。
在下文中一共展示了ServerNotActiveException.printStackTrace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setHostResult
import java.rmi.server.ServerNotActiveException; //导入方法依赖的package包/类
@Override
public void setHostResult(HostAndCommand hostAndCommand, HostResult result) {
try {
Log.warning("set host result "+ hostAndCommand +" from "+ getClientHost());
} catch (ServerNotActiveException snae) {
snae.printStackTrace();
}
activeHostCommands.remove(hostAndCommand);
incompleteHostCommands.remove(hostAndCommand);
completeHostCommands.add(hostAndCommand);
if (incompleteHostCommands.size() == 0) {
try {
pendingHostCommands.put(DONE_MARKER);
} catch (InterruptedException ie) {
}
if (terminateUponCompletion) {
if (beginTermination()) {
displayIncomplete();
}
} else {
displayIncomplete();
}
}
logState();
}
示例2: createSession
import java.rmi.server.ServerNotActiveException; //导入方法依赖的package包/类
@Override
public long createSession(String name, String password) throws java.rmi.RemoteException {
try {
validate(name, password);
} catch (JDependException e1) {
e1.printStackTrace();
throw new RemoteException(e1.getMessage(), e1);
}
JDependSession session = new JDependSession();
session.setId(UUID.randomUUID().getLeastSignificantBits());
session.setUserName(name);
try {
session.setClient(getClientHost());
} catch (ServerNotActiveException e) {
e.printStackTrace();
}
JDependSessionMgr.getInstance().putSession(session);
return session.getId();
}
示例3: notifyStateChange
import java.rmi.server.ServerNotActiveException; //导入方法依赖的package包/类
/**
* notify all clients of state change. If connection fails, this will modify
* client hashmaps. Therefore callers should not iterate directly over the
* clientWaitingForAgent and clientWaitingForHuman arrays.
*
* @param newState
* @throws RemoteException
*/
public void notifyStateChange(EnvironmentState newState) {
// duplicate the set before iteration, since we may call
// unregisterClient.
Set<BW4TClientActions> clientset = new HashSet<>(this.clients.keySet());
for (BW4TClientActions client : clientset) {
try {
client.handleStateChange(newState);
} catch (RemoteException e) {
reportClientProblem(client, e);
try {
unregisterClient(client);
} catch (ServerNotActiveException e1) {
e1.printStackTrace();
}
}
}
}
示例4: execute
import java.rmi.server.ServerNotActiveException; //导入方法依赖的package包/类
/**
* Executes an object a specified number of times.
*
* @param obj a <code>ServerExecutor</code>
* @param times of the executions
* @param arguments an arbitrary number of hosts
* @return a result of the execution
* @throws RemoteException if the remote operation fails
*/
public Object execute(ServerExecutor obj, int times, Object... arguments)
throws RemoteException {
if (!imInServer()) {
try {
System.out.println("\t\tExcecuting execute client: " + getClientHost() + " my: " + ReportIPServer.localHost());
} catch (ServerNotActiveException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
for (int i = 0; i < times - 1; i++) {
obj.execute(arguments);
}
return obj.execute(arguments);
}
示例5: sumMatrixAB
import java.rmi.server.ServerNotActiveException; //导入方法依赖的package包/类
public int[][] sumMatrixAB() {
if ((m1 == null)|| (m2 == null)) {
throw new RuntimeException("Matrix not loaded");
}
try {
System.out.println("add Matrix called from "+getClientHost());
} catch (ServerNotActiveException e) {
e.printStackTrace();
}
int[][] result = new int[m1.length][m2.length];
int i, j;
for (i = 0; i < m1.length; i++) {
for (j = 0; j < m2.length; j++) {
result [i][j] = m1 [i][j] + m2 [i][j];
}
}
System.out.println("Result Matrix (add)");
System.out.println(Arrays.toString(result[0]));
System.out.println(Arrays.toString(result[1]));
System.out.println();
return result;
}
示例6: sumMatrixAB
import java.rmi.server.ServerNotActiveException; //导入方法依赖的package包/类
public BigInteger[][] sumMatrixAB() {
if ((m1 == null)|| (m2 == null)) {
throw new RuntimeException("Matrix not loaded");
}
try {
System.out.println("add Matrix called from "+getClientHost());
} catch (ServerNotActiveException e) {
e.printStackTrace();
}
BigInteger[][] result = new BigInteger[m1.length][m2.length];
int i, j;
for (i = 0; i < m1.length; i++) {
for (j = 0; j < m2.length; j++) {
result [i][j] = m1 [i][j].add(m2 [i][j]);
}
}
System.out.println("Result Matrix (add)");
System.out.println(Arrays.toString(result[0]));
System.out.println(Arrays.toString(result[1]));
System.out.println();
return result;
}
示例7: sumMatrixAB
import java.rmi.server.ServerNotActiveException; //导入方法依赖的package包/类
public int[][] sumMatrixAB() {
if ((m1 == null) || (m2 == null)) {
throw new RuntimeException("Matrix not loaded");
}
try {
System.out.println("add Matrix called from " + getClientHost());
} catch (ServerNotActiveException e) {
e.printStackTrace();
}
int[][] result = new int[m1.length][m2.length];
int i, j;
for (i = 0; i < m1.length; i++) {
for (j = 0; j < m2.length; j++) {
result[i][j] = m1[i][j] + m2[i][j];
}
}
System.out.println("Result Matrix (add)");
System.out.println(Arrays.toString(result[0]));
System.out.println(Arrays.toString(result[1]));
System.out.println();
return result;
}
示例8: sumMatrixAB
import java.rmi.server.ServerNotActiveException; //导入方法依赖的package包/类
public BigInteger[][] sumMatrixAB() {
if ((m1 == null) || (m2 == null)) {
throw new RuntimeException("Matrix not loaded");
}
try {
System.out.println("add Matrix called from " + getClientHost());
} catch (ServerNotActiveException e) {
e.printStackTrace();
}
BigInteger[][] result = new BigInteger[m1.length][m2.length];
int i, j;
for (i = 0; i < m1.length; i++) {
for (j = 0; j < m2.length; j++) {
result[i][j] = m1[i][j].add(m2[i][j]);
}
}
System.out.println("Result Matrix (add)");
System.out.println(Arrays.toString(result[0]));
System.out.println(Arrays.toString(result[1]));
System.out.println();
return result;
}
示例9: workerComplete
import java.rmi.server.ServerNotActiveException; //导入方法依赖的package包/类
@Override
public void workerComplete() throws RemoteException {
try {
Log.warning("worker complete from "+ getClientHost());
} catch (ServerNotActiveException snae) {
snae.printStackTrace();
}
completedWorkers.release();
Log.warning("Worker complete: ", completedWorkers.availablePermits());
}
示例10: sayHello
import java.rmi.server.ServerNotActiveException; //导入方法依赖的package包/类
public String sayHello() throws RemoteException {
try {
System.out.println("LOG: "+ ServidorHola.class.getName()
+ ": registra(): "+ getClientHost() );
} catch (ServerNotActiveException e) {
e.printStackTrace();
}
return "Hola, mundo!";
}
示例11: saluda
import java.rmi.server.ServerNotActiveException; //导入方法依赖的package包/类
public String saluda(String nombre) throws RemoteException {
String ip=null;
try {
ip = this.getClientHost();
} catch (ServerNotActiveException snae) {
snae.printStackTrace(System.err);
}
listado.put(ip, nombre);
return (String) ("Hola, "+nombre+" !");
}
示例12: save
import java.rmi.server.ServerNotActiveException; //导入方法依赖的package包/类
public int save(comments p) throws ClassNotFoundException {
try {
System.out.println("Invoke update from " + getClientHost());
} catch (ServerNotActiveException snae) {
snae.printStackTrace();
}
return CommentsRepository.save(p);
}
示例13: update
import java.rmi.server.ServerNotActiveException; //导入方法依赖的package包/类
public int update(comments p) throws ClassNotFoundException {
try {
System.out.println("Invoke update from " + getClientHost());
} catch (ServerNotActiveException snae) {
snae.printStackTrace();
}
return CommentsRepository.update(p);
}
示例14: findById
import java.rmi.server.ServerNotActiveException; //导入方法依赖的package包/类
public ArrayList<comments> findById(int criteria) throws ClassNotFoundException{
try {
System.out.println("Invoke findAll from " + getClientHost());
} catch (ServerNotActiveException snae) {
snae.printStackTrace();
}
return CommentsRepository.findById(criteria);
}
示例15: findByDoctor
import java.rmi.server.ServerNotActiveException; //导入方法依赖的package包/类
public ArrayList<comments> findByDoctor(String criteria) throws ClassNotFoundException{
try {
System.out.println("Invoke findAll from " + getClientHost());
} catch (ServerNotActiveException snae) {
snae.printStackTrace();
}
return CommentsRepository.findByDoctor(criteria);
}