本文整理了Java中com.arjuna.ats.internal.arjuna.Header
类的一些代码示例,展示了Header
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Header
类的具体详情如下:
包路径:com.arjuna.ats.internal.arjuna.Header
类名称:Header
暂无
代码示例来源:origin: jboss.jbossts/jbossjts
BasicAction action = BasicAction.Current();
packHeader(os, new Header(null, Utility.getProcessUid()));
else
packHeader(os, new Header(action.get_uid(), Utility.getProcessUid()));
代码示例来源:origin: org.jboss.jbossts/jbossjta
Uid txId = ((hdr == null) ? null : hdr.getTxId());
Uid processUid = ((hdr == null) ? null : hdr.getProcessId());
os.packString(StateManager.marker);
UidHelper.packInto(txId, os);
UidHelper.packInto(processUid, os);
UidHelper.packInto(Uid.nullUid(), os);
tsLogger.logger.trace("StateManager.packHeader for object-id " + get_uid()
+ " birth-date " + birthDate);
os.packLong(birthDate);
代码示例来源:origin: org.jboss.jbossts/jbossjta
Uid processUid = null;
String myState = os.unpackString();
txId = UidHelper.unpackFrom(os);
if (!txId.equals(Uid.nullUid()))
processUid = UidHelper.unpackFrom(os);
tsLogger.i18NLogger.warn_StateManager_9();
throw new IOException(tsLogger.i18NLogger.get_StateManager_15());
long birthDate = os.unpackLong();
tsLogger.logger.trace("StateManager.unpackHeader for object-id " + get_uid()
+ " birth-date " + birthDate);
hdr.setTxId(txId);
hdr.setProcessId(processUid);
代码示例来源:origin: jboss.jbossts/jbossjts
/**
* Override StateManager packHeader so it gets the original processUid, not
* this process's
*
* @since JTS 2.1.
*/
protected void packHeader (OutputObjectState os, Header hdr)
throws IOException
{
/*
* If there is a transaction present than pack the process Uid of this
* JVM and the tx id. Otherwise pack a null Uid.
*/
super.packHeader(os, new Header(hdr.getTxId(), _originalProcessUid));
}
代码示例来源:origin: org.jboss.narayana.arjunacore/arjunacore
packHeader(os, new Header(get_uid(), Utility.getProcessUid()));
os.packBoolean(pastFirstParticipant);
if ((failedList != null) && (failedList.size() > 0))
AbstractRecord first = ((listToSave != null) ? listToSave.getFront()
: null);
AbstractRecord temp = first;
listToSave.putRear(temp);
tsLogger.logger.trace("BasicAction::save_state - next record to pack is a "+temp.typeIs()
+" record "+temp.type()+" should save it? = "+temp.doSave());
os.packInt(temp.typeIs());
res = temp.save_state(os, ot);
if (res && (os.notempty() || !havePacked))
tsLogger.logger.trace("Packing action status of "+ActionStatus.stringForm(actionStatus));
代码示例来源:origin: org.jboss.jbossts.arjunacore/arjunacore
createPreparedLists();
Header hdr = new Header();
unpackHeader(os, hdr);
pastFirstParticipant = os.unpackBoolean();
record_type = os.unpackInt();
AbstractRecord record = AbstractRecord.create(record_type);
tsLogger.i18NLogger.warn_coordinator_BasicAction_21(Integer.toString(record_type));
res = (record.restore_state(os, ot) && preparedList.insert(record));
record_type = os.unpackInt();
AbstractRecord record = AbstractRecord.create(record_type);
res = (record.restore_state(os, ot) && heuristicList.insert(record));
record_type = os.unpackInt();
tsLogger.i18NLogger.warn_coordinator_norecordfound(Integer.toString(record_type));
tsLogger.i18NLogger.warn_coordinator_BasicAction_24();
代码示例来源:origin: org.jboss.jbossts.jta/narayana-jta
_originalProcessUid = new Uid(Uid.nullUid());
Header hdr = new Header();
_originalProcessUid = hdr.getProcessId();
_owningTransactionUid = hdr.getTxId();
return _owningTransactionUid.notEquals(Uid.nullUid());
代码示例来源:origin: jbosstm/narayana
public boolean restore_state (InputObjectState os, int t)
{
_theXid = null;
try
{
unpackHeader(os, new Header());
boolean haveXid = os.unpackBoolean();
if (haveXid)
{
_theXid = new XidImple();
((XidImple) _theXid).unpackFrom(os);
_parentNodeName = os.unpackString();
}
}
catch (IOException ex)
{
return false;
}
return super.restore_state(os, t);
}
代码示例来源:origin: org.jboss.jbossts.jta/narayana-jta
public RecoverConnectableAtomicAction(String type, Uid rcvUid, InputObjectState os)
throws ObjectStoreException, IOException {
super(rcvUid);
this.recoveringAs = type;
// Unpack BasicAction::save_state preamble
Header hdr = new Header();
unpackHeader(os, hdr);
os.unpackBoolean(); // FYI pastFirstParticipant
// Take a look at the first record type
int record_type = os.unpackInt();
if (record_type == RecordType.COMMITMARKABLERESOURCE) {
// Its one we are interested in
jndiName = os.unpackString();
xid = XidImple.unpack(os);
hasCompleted = os.unpackBoolean();
}
}
代码示例来源:origin: org.jboss.jbossts.jta/narayana-jta
public boolean save_state (OutputObjectState os, int t)
{
try
{
// pack the header first for the benefit of the tooling
packHeader(os, new Header(get_uid(), Utility.getProcessUid()));
if (_theXid != null)
{
os.packBoolean(true);
((XidImple) _theXid).packInto(os);
os.packString(_parentNodeName);
}
else
os.packBoolean(false);
}
catch (IOException ex)
{
return false;
}
return super.save_state(os, t);
}
代码示例来源:origin: jboss.jbossts/jbossjts
createPreparedLists();
Header hdr = new Header();
unpackHeader(os, hdr);
record_type = os.unpackInt();
AbstractRecord record = AbstractRecord.create(record_type);
res = (record.restore_state(os, ot) && preparedList.insert(record));
record_type = os.unpackInt();
hSize = os.unpackInt();
AbstractRecord record = AbstractRecord.create(record_type);
res = (record.restore_state(os, ot) && heuristicList.insert(record));
{ ActionStatus.stringForm(tempActionStatus), Integer.toString(tempActionStatus) });
代码示例来源:origin: jboss.jbossts/jbossjts
/**
* These methods must be provided by a derived class. They are responsible
* for packing and unpacking an object's state to/from a state buffer.
* StateManager calls them at appropriate times during the lifetime of the
* object, and may then pass the buffer to a persistent object store for
* saving.
*
* @return <code>true</code> on success, <code>false</code> otherwise.
*/
public boolean restore_state (InputObjectState os, int ot)
{
if (ot == ObjectType.ANDPERSISTENT)
{
try
{
unpackHeader(os, new Header());
}
catch (IOException e)
{
return false;
}
}
return true;
}
代码示例来源:origin: jboss.jbossts/jbossjts
/**
* Override StateManager's unpackHeader to save the processUid of the
* original process
*
* @since JTS 2.1.
*/
protected void unpackHeader (InputObjectState os, Header hdr)
throws IOException
{
super.unpackHeader(os, hdr);
super.objectUid = hdr.getTxId();
_originalProcessUid = hdr.getProcessId();
if (jtsLogger.loggerI18N.isDebugEnabled())
{
jtsLogger.loggerI18N
.debug(
DebugLevel.FUNCTIONS,
VisibilityLevel.VIS_PUBLIC,
FacilityCode.FAC_CRASH_RECOVERY,
"com.arjuna.ats.internal.jts.recovery.transactions.RecoveredServerTransaction_16",
new Object[]
{ get_uid(), _originalProcessUid });
}
}
代码示例来源:origin: jboss.jbossts/jbossjts
/**
* Override StateManager's unpackHeader to save the processUid of the
* original process
*
* @since JTS 2.1.
*/
protected void unpackHeader (InputObjectState os, Header hdr)
throws IOException
{
super.unpackHeader(os, hdr);
_originalProcessUid = hdr.getProcessId();
}
代码示例来源:origin: org.jboss.narayana.jts/narayana-jts-idlj
/**
* Override StateManager packHeader so it gets the original processUid, not
* this process's
*
* @since JTS 2.1.
*/
protected void packHeader (OutputObjectState os, Header hdr)
throws IOException
{
/*
* If there is a transaction present than pack the process Uid of this
* JVM and the tx id. Otherwise pack a null Uid.
*/
super.packHeader(os, new Header(get_uid(), _originalProcessUid));
}
代码示例来源:origin: jbosstm/narayana
packHeader(os, new Header(get_uid(), Utility.getProcessUid()));
os.packBoolean(pastFirstParticipant);
if ((failedList != null) && (failedList.size() > 0))
AbstractRecord first = ((listToSave != null) ? listToSave.getFront()
: null);
AbstractRecord temp = first;
listToSave.putRear(temp);
tsLogger.logger.trace("BasicAction::save_state - next record to pack is a "+temp.typeIs()
+" record "+temp.type()+" should save it? = "+temp.doSave());
os.packInt(temp.typeIs());
res = temp.save_state(os, ot);
if (res && (os.notempty() || !havePacked))
tsLogger.logger.trace("Packing action status of "+ActionStatus.stringForm(actionStatus));
代码示例来源:origin: org.jboss.narayana.arjunacore/arjunacore
createPreparedLists();
Header hdr = new Header();
unpackHeader(os, hdr);
pastFirstParticipant = os.unpackBoolean();
record_type = os.unpackInt();
AbstractRecord record = AbstractRecord.create(record_type);
tsLogger.i18NLogger.warn_coordinator_BasicAction_21(Integer.toString(record_type));
res = (record.restore_state(os, ot) && preparedList.insert(record));
record_type = os.unpackInt();
tsLogger.logger.warn("Transaction "+get_uid()+" has "+hSize+" heuristic participant(s)!");
AbstractRecord record = AbstractRecord.create(record_type);
res = (record.restore_state(os, ot) && heuristicList.insert(record));
record_type = os.unpackInt();
tsLogger.i18NLogger.warn_coordinator_norecordfound(Integer.toString(record_type));
代码示例来源:origin: org.jboss.narayana.arjunacore/arjunacore
_originalProcessUid = new Uid(Uid.nullUid());
Header hdr = new Header();
_originalProcessUid = hdr.getProcessId();
_owningTransactionUid = hdr.getTxId();
return _owningTransactionUid.notEquals(Uid.nullUid());
代码示例来源:origin: org.jboss.narayana.jta/jta
public boolean restore_state (InputObjectState os, int t)
{
_theXid = null;
try
{
unpackHeader(os, new Header());
boolean haveXid = os.unpackBoolean();
if (haveXid)
{
_theXid = new XidImple();
((XidImple) _theXid).unpackFrom(os);
_parentNodeName = os.unpackString();
}
}
catch (IOException ex)
{
return false;
}
return super.restore_state(os, t);
}
代码示例来源:origin: org.jboss.narayana.jts/narayana-jts-idlj
public RecoverConnectableAtomicAction(String type, Uid rcvUid, InputObjectState os)
throws ObjectStoreException, IOException {
super(rcvUid);
this.recoveringAs = type;
// Unpack BasicAction::save_state preamble
Header hdr = new Header();
unpackHeader(os, hdr);
os.unpackBoolean(); // FYI pastFirstParticipant
// Take a look at the first record type
int record_type = os.unpackInt();
if (record_type == RecordType.COMMITMARKABLERESOURCE) {
// Its one we are interested in
jndiName = os.unpackString();
xid = XidImple.unpack(os);
hasCompleted = os.unpackBoolean();
if (hasCompleted) {
wasCommitted = os.unpackBoolean();
}
}
}
内容来源于网络,如有侵权,请联系作者删除!