public int getEstimatedEventSize(FireableEventType eventType, Object event) { return marshaler.getEstimatedEventSize(eventType, event); }
public ByteBuffer getEventBuffer(FireableEventType eventType, Object event) { return marshaler.getEventBuffer(eventType, event); }
public void marshalEvent(FireableEventType eventType, Object event, DataOutput out) throws IOException { marshaler.marshalEvent(eventType, event, out); }
public void marshalHandle(ActivityHandle handle, DataOutput out) throws IOException { marshaler.marshalHandle(raEntity.derreferActivityHandle(handle), out); }
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { // read ra entity name final String raEntityName = in.readUTF(); // read activity handle this.raEntity = SleeContainer.lookupFromJndi().getResourceManagement() .getResourceAdaptorEntity(raEntityName); if (raEntity == null) { throw new IOException("RA Entity with name " + raEntityName + " not found."); } // read activity handle boolean handleReference = in.readBoolean(); if (handleReference) { // a reference activityHandle = new ActivityHandleReference(null, (Address) in.readObject(), in.readUTF()); } else { final Marshaler marshaler = raEntity.getMarshaler(); if (marshaler != null) { activityHandle = marshaler.unmarshalHandle(in); } else { throw new IOException("marshaller from RA is null"); } } }
public Object unmarshalEvent(FireableEventType eventType, DataInput in) throws IOException { return marshaler.unmarshalEvent(eventType, in); }
public void releaseEventBuffer(FireableEventType eventType, Object event, ByteBuffer buffer) { marshaler.releaseEventBuffer(eventType, event, buffer); }
public int getEstimatedHandleSize(ActivityHandle handle) { return marshaler.getEstimatedHandleSize(raEntity.derreferActivityHandle(handle)); }
public ByteBuffer marshalledVersion(){ ResourceAdaptorEntity raEntity = container.getResourceAdaptorEnitity(this.raEntityName); ResourceAdaptor ra = raEntity.getResourceAdaptor(); Marshaler marshaller = ra.getMarshaler(); try { return marshaller.marshalHandle(this.handle); } catch (IOException e) { e.printStackTrace(); } return null; }
public ActivityHandle unmarshalHandle(DataInput in) throws IOException { final ActivityHandle ah = marshaler.unmarshalHandle(in); if (raEntity.getHandleReferenceFactory() == null) { return ah; } else { return raEntity.getHandleReferenceFactory().getReferenceTransacted(ah); } }
@Override public void writeExternal(ObjectOutput out) throws IOException { // write ra entity name out.writeUTF(raEntity.getName()); // write activity handle if (activityHandle.getClass() == ActivityHandleReference.class) { // a reference out.writeBoolean(true); final ActivityHandleReference reference = (ActivityHandleReference) activityHandle; out.writeObject(reference.getAddress()); out.writeUTF(reference.getId()); } else { out.writeBoolean(false); final Marshaler marshaler = raEntity.getMarshaler(); if (marshaler != null) { marshaler.marshalHandle(activityHandle, out); } else { throw new IOException("marshaller from RA is null"); } } }