Skip to content

Instantly share code, notes, and snippets.

View njofce's full-sized avatar

Nasi njofce

  • Skopje
View GitHub Profile
https://github.com/blag0j/sunny-apps
https://github.com/njofce/api
https://github.com/blag0j/sunny-apps
https://github.com/njofce/api
class QueueStack<T> {
private List<T> dataCollection;
QueueStack() {
dataCollection = new LinkedList<>();
}
void push(T item) {
dataCollection.add(0, item);
public interface Action {
void execute();
void undo();
String getName();
}
public class Action1 implements Action {
private String name;
public Action1(String name) {
this.name = name;
}
@Override
public void execute() {
class CommandManager {
private static CommandManager instance = null;
private QueueStack<List<Action>> queueStackNormal;
private QueueStack<List<Action>> queueStackReverse;
private List<String> actionHistory;
static CommandManager getInstance(){
if(instance != null)
return instance;
class CommandManager {
private static CommandManager instance = null;
private QueueStack<List<Action>> queueStackNormal;
private QueueStack<List<Action>> queueStackReverse;
private List<String> actionHistory;
static CommandManager getInstance(){
if(instance != null)
return instance;
@Autowired
private InstitutionManagementClient institutionManagementClient; // This is the Feign client
@HystrixCommand(fallbackMethod = “getAssociatedInstitutionFallback”,
threadPoolKey = “threadPoolInstitution”,
threadPoolProperties = {
@HystrixProperty(name = “coreSize”, value = “15”),
@HystrixProperty(name = “maxQueueSize”, value = “5”)
}
)
@HystrixCommand(fallbackMethod = “getAssociatedInstitutionFallback”,
threadPoolKey = “threadPoolInstitution”,
threadPoolProperties = {
@HystrixProperty(name = “coreSize”, value = “15”),
@HystrixProperty(name = “maxQueueSize”, value = “5”)
},
commandPoolProperties = {
@HystrixProperty(name=”circuitBreaker.requestVolumeThreshold”, value = ”5”)
@HystrixProperty(name=”circuitBreaker.errorThresholdPercentage”, value = “50”)
}