@Override public <T extends TransactionalObject> T getTransactionalObject(String serviceName, String name) { if (transaction.getState() != Transaction.State.ACTIVE) { throw new TransactionNotActiveException("No transaction is found while accessing " + "transactional object -> " + serviceName + "[" + name + "]!"); } TransactionalObjectKey key = new TransactionalObjectKey(serviceName, name); TransactionalObject obj = txnObjectMap.get(key); if (obj == null) { if (serviceName.equals(QueueService.SERVICE_NAME)) { obj = new ClientTxnQueueProxy(name, this); } else if (serviceName.equals(MapService.SERVICE_NAME)) { obj = new ClientTxnMapProxy(name, this); } else if (serviceName.equals(MultiMapService.SERVICE_NAME)) { obj = new ClientTxnMultiMapProxy(name, this); } else if (serviceName.equals(ListService.SERVICE_NAME)) { obj = new ClientTxnListProxy(name, this); } else if (serviceName.equals(SetService.SERVICE_NAME)) { obj = new ClientTxnSetProxy(name, this); } if (obj == null) { throw new IllegalArgumentException("Service[" + serviceName + "] is not transactional!"); } txnObjectMap.put(key, obj); } return (T) obj; }
@Override public <T extends TransactionalObject> T getTransactionalObject(String serviceName, String name) { if (transaction.getState() != Transaction.State.ACTIVE) { throw new TransactionNotActiveException("No transaction is found while accessing " + "transactional object -> " + serviceName + "[" + name + "]!"); } TransactionalObjectKey key = new TransactionalObjectKey(serviceName, name); TransactionalObject obj = txnObjectMap.get(key); if (obj == null) { if (serviceName.equals(QueueService.SERVICE_NAME)) { obj = new ClientTxnQueueProxy(name, this); } else if (serviceName.equals(MapService.SERVICE_NAME)) { obj = new ClientTxnMapProxy(name, this); } else if (serviceName.equals(MultiMapService.SERVICE_NAME)) { obj = new ClientTxnMultiMapProxy(name, this); } else if (serviceName.equals(ListService.SERVICE_NAME)) { obj = new ClientTxnListProxy(name, this); } else if (serviceName.equals(SetService.SERVICE_NAME)) { obj = new ClientTxnSetProxy(name, this); } if (obj == null) { throw new IllegalArgumentException("Service[" + serviceName + "] is not transactional!"); } txnObjectMap.put(key, obj); } return (T) obj; }
@Override public <T extends TransactionalObject> T getTransactionalObject(String serviceName, String name) { if (transaction.getState() != Transaction.State.ACTIVE) { throw new TransactionNotActiveException("No transaction is found while accessing " + "transactional object -> " + serviceName + "[" + name + "]!"); } TransactionalObjectKey key = new TransactionalObjectKey(serviceName, name); TransactionalObject obj = txnObjectMap.get(key); if (obj == null) { if (serviceName.equals(QueueService.SERVICE_NAME)) { obj = new ClientTxnQueueProxy(name, this); } else if (serviceName.equals(MapService.SERVICE_NAME)) { obj = new ClientTxnMapProxy(name, this); } else if (serviceName.equals(MultiMapService.SERVICE_NAME)) { obj = new ClientTxnMultiMapProxy(name, this); } else if (serviceName.equals(ListService.SERVICE_NAME)) { obj = new ClientTxnListProxy(name, this); } else if (serviceName.equals(SetService.SERVICE_NAME)) { obj = new ClientTxnSetProxy(name, this); } if (obj == null) { throw new IllegalArgumentException("Service[" + serviceName + "] is not transactional!"); } txnObjectMap.put(key, obj); } return (T) obj; }
@Override public <T extends TransactionalObject> T getTransactionalObject(String serviceName, String name) { if (transaction.getState() != Transaction.State.ACTIVE) { throw new TransactionNotActiveException("No transaction is found while accessing " + "transactional object -> " + serviceName + "[" + name + "]!"); } TransactionalObjectKey key = new TransactionalObjectKey(serviceName, name); TransactionalObject obj = txnObjectMap.get(key); if (obj == null) { if (serviceName.equals(QueueService.SERVICE_NAME)) { obj = new ClientTxnQueueProxy(name, this); } else if (serviceName.equals(MapService.SERVICE_NAME)) { obj = new ClientTxnMapProxy(name, this); } else if (serviceName.equals(MultiMapService.SERVICE_NAME)) { obj = new ClientTxnMultiMapProxy(name, this); } else if (serviceName.equals(ListService.SERVICE_NAME)) { obj = new ClientTxnListProxy(name, this); } else if (serviceName.equals(SetService.SERVICE_NAME)) { obj = new ClientTxnSetProxy(name, this); } if (obj == null) { throw new IllegalArgumentException("Service[" + serviceName + "] is not transactional!"); } txnObjectMap.put(key, obj); } return (T) obj; }
@SuppressWarnings("unchecked") @Override public TransactionalObject getTransactionalObject(String serviceName, String name) { if (transaction.getState() != Transaction.State.ACTIVE) { throw new TransactionNotActiveException("No transaction is found while accessing " + "transactional object -> " + serviceName + "[" + name + "]!"); } TransactionalObjectKey key = new TransactionalObjectKey(serviceName, name); TransactionalObject obj = txnObjectMap.get(key); if (obj != null) { return obj; } final Object service = nodeEngine.getService(serviceName); if (service instanceof TransactionalService) { nodeEngine.getProxyService().initializeDistributedObject(serviceName, name); obj = ((TransactionalService) service).createTransactionalObject(name, transaction); txnObjectMap.put(key, obj); } else { throw new IllegalArgumentException("Service[" + serviceName + "] is not transactional!"); } return obj; }
@SuppressWarnings("unchecked") @Override public TransactionalObject getTransactionalObject(String serviceName, String name) { if (transaction.getState() != Transaction.State.ACTIVE) { throw new TransactionNotActiveException("No transaction is found while accessing " + "transactional object -> " + serviceName + "[" + name + "]!"); } TransactionalObjectKey key = new TransactionalObjectKey(serviceName, name); TransactionalObject obj = txnObjectMap.get(key); if (obj != null) { return obj; } final Object service = nodeEngine.getService(serviceName); if (service instanceof TransactionalService) { nodeEngine.getProxyService().initializeDistributedObject(serviceName, name); obj = ((TransactionalService) service).createTransactionalObject(name, transaction); txnObjectMap.put(key, obj); } else { throw new IllegalArgumentException("Service[" + serviceName + "] is not transactional!"); } return obj; }
@SuppressWarnings("unchecked") @Override public TransactionalObject getTransactionalObject(String serviceName, String name) { checkActive(serviceName, name); if (requiresBackupLogs(serviceName)) { transaction.ensureBackupLogsExist(); } TransactionalObjectKey key = new TransactionalObjectKey(serviceName, name); TransactionalObject obj = txnObjectMap.get(key); if (obj != null) { return obj; } TransactionalService transactionalService = getTransactionalService(serviceName); nodeEngine.getProxyService().initializeDistributedObject(serviceName, name); obj = transactionalService.createTransactionalObject(name, transaction); txnObjectMap.put(key, obj); return obj; }
@SuppressWarnings("unchecked") @Override public TransactionalObject getTransactionalObject(String serviceName, String name) { checkActive(serviceName, name); if (requiresBackupLogs(serviceName)) { transaction.ensureBackupLogsExist(); } TransactionalObjectKey key = new TransactionalObjectKey(serviceName, name); TransactionalObject obj = txnObjectMap.get(key); if (obj != null) { return obj; } TransactionalService transactionalService = getTransactionalService(serviceName); nodeEngine.getProxyService().initializeDistributedObject(serviceName, name); obj = transactionalService.createTransactionalObject(name, transaction); txnObjectMap.put(key, obj); return obj; }