public final InputObjectState allObjUids () throws ObjectStoreException { OutputObjectState state = new OutputObjectState(); Iterator<Uid> iter = _ids.keySet().iterator(); try { while (iter.hasNext()) { UidHelper.packInto(iter.next(), state); } // don't forget to null terminate UidHelper.packInto(Uid.nullUid(), state); } catch (final IOException ex) { throw new ObjectStoreException(ex); } return new InputObjectState(state); }
OutputObjectState store = new OutputObjectState(); Uid aUid = new Uid(entry[i], true); if (!aUid.valid() || (aUid.equals(Uid.nullUid()))) UidHelper.packInto(aUid, store); throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_FileSystemStore_2a(), e); UidHelper.packInto(Uid.nullUid(), store); throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_FileSystemStore_3(), e); state.setBuffer(store.buffer());
OutputObjectState store = new OutputObjectState(); Uid aUid = new Uid(dirEnt[j], true); if (!aUid.valid() || (aUid.equals(Uid.nullUid()))) UidHelper.packInto(aUid, store); throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_HashedStore_5(), e); UidHelper.packInto(Uid.nullUid(), store); throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_HashedStore_6(), e); state.setBuffer(store.buffer());
OutputObjectState store = new OutputObjectState(); Statement stmt = _theConnection[pool].createStatement(); ResultSet rs = null; theUid = new Uid(rs.getString(1)); UidHelper.packInto(theUid, store); tsLogger.i18NLogger.warn_objectstore_JDBCImple_5(ex); tsLogger.i18NLogger.warn_objectstore_JDBCImple_4(e); tsLogger.i18NLogger.warn_objectstore_JDBCImple_4(e); UidHelper.packInto(Uid.nullUid(), store); throw new ObjectStoreException("allObjUids - could not pack end of list Uid.", e); state.setBuffer(store.buffer());
return true; OutputObjectState store = new OutputObjectState(); store.packString(entry[i]); throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_FileSystemStore_4(), e); store.packString(""); throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_FileSystemStore_5(), e); foundTypes.setBuffer(store.buffer());
/** * Obtain all of the Uids for a specified type. * * @param s The type to scan for. * @param buff The object state in which to store the Uids * @param m The file type to look for (e.g., committed, shadowed). * @return <code>true</code> if no errors occurred, <code>false</code> * otherwise. */ public boolean allObjUids(String s, InputObjectState buff, int m) throws ObjectStoreException { if (stateTypes == null) throw new ObjectStoreException("Operation not supported by this implementation"); OutputObjectState store = new OutputObjectState(); for (Map.Entry<Uid, String> entry : stateTypes.entrySet()) if (entry.getValue().equals(s)) packUid(store, entry.getKey()); packUid(store, Uid.nullUid()); buff.setBuffer(store.buffer()); return true; }
if (!u.equals(Uid.nullUid())) { RecoveryStore recoveryStore = StoreManager.getRecoveryStore(); String transactionType = SubordinateAtomicAction.getType(); InputObjectState states = new InputObjectState(); try { if (recoveryStore.allObjUids(transactionType, states) && (states.notempty())) { Stack values = new Stack(); boolean finished = false; uid = UidHelper.unpackFrom(states); } catch (IOException ex) { ex.printStackTrace(); if (uid.notEquals(Uid.nullUid())) { SubordinateAtomicAction tx = new SubordinateAtomicAction(uid, true); XidImple transactionXid = (XidImple) tx.getXid(); e.printStackTrace(); } catch (IOException e) {
private boolean isInStore(Xid xid) { final RecoveryStore recoveryStore = StoreManager.getRecoveryStore(); final InputObjectState states = new InputObjectState(); try { if (recoveryStore.allObjUids(SubordinateAtomicAction.getType(), states) && states.notempty()) { boolean finished = false; do { final Uid uid = UidHelper.unpackFrom(states); if (uid.notEquals(Uid.nullUid())) { final SubordinateAtomicAction saa = new SubordinateAtomicAction(uid, true); if (saa.getXid().equals(xid)) { return true; } } else { finished = true; } } while (!finished); } } catch (ObjectStoreException e) { LOG.warn(e.getMessage(), e); } catch (IOException e) { LOG.warn(e.getMessage(), e); } return false; }
if (targetParticipantStore.write_uncommitted(oState.stateUid(), oState.type(), oState)) e.printStackTrace();
private void packString(OutputObjectState store, String s) throws ObjectStoreException { try { store.packString(s); } catch (IOException e) { throw new ObjectStoreException("TypedVolatileStore::packString - could not pack string: " + e.getMessage()); } } }
public boolean doRemove() { try { if (StoreManager.getRecoveryStore().remove_committed(getUid(), _uidWrapper.getType())) return true; if (tsLogger.logger.isDebugEnabled()) tsLogger.logger.debugf("%s %s", REMOVE_NOK_1, getUid().toString()); return false; } catch (ObjectStoreException e) { if (tsLogger.logger.isDebugEnabled()) tsLogger.logger.debugf("%s %s - %s", REMOVE_NOK_1, getUid().toString(), e.getMessage()); return false; } }
/** * Read the object's committed state. * * @param uid The object to work on. * @param typeName The type of the object to work on. * @return the state of the object. * @throws ObjectStoreException if things go wrong. */ public InputObjectState read_committed(Uid uid, String typeName) throws ObjectStoreException { RecordInfo record = getContentForType(typeName).get(uid); if(record == null) { return null; } // this repeated unpacking is a little inefficient - subclass RecordInfo to hold unpacked form too? // not too much of an issue as log reads are done for recovery only. try { InputBuffer inputBuffer = new InputBuffer(record.data); UidHelper.unpackFrom(inputBuffer); inputBuffer.unpackString(); return new InputObjectState(uid, typeName, inputBuffer.unpackBytes()); } catch(Exception e) { throw new ObjectStoreException(e); } }
foundTypes.packString(root+File.separator+pack); throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_FileSystemStore_7(), e);
private void packUid(OutputObjectState store, Uid uid) throws ObjectStoreException { try { UidHelper.packInto(uid, store); } catch (IOException e) { throw new ObjectStoreException("TypedVolatileStore::packUid - could not pack uid: " + e.getMessage()); } }
public FileSystemStore(ObjectStoreEnvironmentBean objectStoreEnvironmentBean) throws ObjectStoreException { super(objectStoreEnvironmentBean); fullStoreName = locateStore(_objectStoreRoot); doSync = objectStoreEnvironmentBean.isObjectStoreSync(); scanZeroLengthFiles = objectStoreEnvironmentBean.isScanZeroLengthFiles(); /* The root of the objectstore must exist and be writable */ if ((fullStoreName == null) || !createHierarchy(fullStoreName)) { throw new ObjectStoreException( tsLogger.i18NLogger.get_objectstore_FileSystemStore_1(fullStoreName) ); } }
/** * Read the object's shadowed state. * * @param u The object to work on. * @param tn The type of the object to work on. * @return the state of the object. */ @Override public InputObjectState read_uncommitted(Uid u, String tn) throws ObjectStoreException { throw new ObjectStoreException(tsLogger.i18NLogger.get_method_not_implemented()); }
public FileSystemStore (int ss) { super(ss); fullStoreName = null; localStoreRoot = null; isValid = true; try { setupStore(arjPropertyManager.getObjectStoreEnvironmentBean().getLocalOSRoot()); } catch (ObjectStoreException e) { isValid = false; throw new com.arjuna.ats.arjuna.exceptions.FatalError(e.toString(), e); } }
protected StateManagerInfo(ObjectStore os, Uid uid, String type) { super(uid); try { unpackHeader(os.read_committed(uid, type)); } catch (IOException e) { if (tsLogger.arjLoggerI18N.isInfoEnabled()) tsLogger.arjLoggerI18N.info("org.jboss.jbosstm.tools.jmx.osb.MbState.m_1", new Object[] { e.getMessage() }); } catch (ObjectStoreException e) { if (tsLogger.arjLoggerI18N.isInfoEnabled()) tsLogger.arjLoggerI18N.info("org.jboss.jbosstm.tools.jmx.osb.MbState.m_1", new Object[] { e.getMessage() }); } }
public static boolean getTransactions (InputObjectState os, int status) { ObjectStore store = TxControl.getStore(); try { return store.allObjUids(com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple.typeName(), os, status); } catch (NullPointerException ex) { } catch (ObjectStoreException e) { e.printStackTrace(); } return false; }
OutputObjectState store = new OutputObjectState(); Uid aUid = new Uid(entry[i], true); if (!aUid.valid() || (aUid.equals(Uid.nullUid()))) UidHelper.packInto(aUid, store); throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_FileSystemStore_2a(), e); UidHelper.packInto(Uid.nullUid(), store); throw new ObjectStoreException(tsLogger.i18NLogger.get_objectstore_FileSystemStore_3(), e); state.setBuffer(store.buffer());