Q:
Android: How c
Q:
Prove $\int_{x
Q:
Why does my ta
The long term goal
The number of pati
Synthesis and stru
//
// Generate
package hclwrite
In recent years, a
Birth of Arianne K/*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.esb.saga.test.framework;
import org.apache.axis2.AxisFault;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.business.exception.CarbonException;
import org.wso2.carbon.commons.test.ConfigurationContext;
import org.wso2.esb.integration.common.utils.common.ServerConfigurationManager;
public class ExceptionLogger extends Thread {
public static final Log log = LogFactory.getLog(ExceptionLogger.class);
private boolean logging = false;
private ConfigurationContext context;
public ExceptionLogger(ConfigurationContext configurationContext) {
this.context = configurationContext;
}
@Override
public void run() {
try {
while (!this.logging) {
log.warn("Exception happened in framework context");
}
throw new AxisFault(new String("test"));
} catch (Exception e) {
log.error("exception message", e);
throw new CarbonException(e);
} finally {
try {
Thread.currentThread().join();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
}
public void setLogger(boolean log) {
this.logging = log;
}
public boolean isLogging() {
return logging;
}
public void resetLogger() {
setLogger(false);
}
public ConfigurationContext getContext() {
return context;
}
public void setConfiguration(ServerConfigurationManager config) {
this.context = config.getConfigurationContext();
}
}