KahaDestination convert(ActiveMQDestination dest) { KahaDestination rc = new KahaDestination(); rc.setName(dest.getPhysicalName()); switch (dest.getDestinationType()) { case ActiveMQDestination.QUEUE_TYPE: rc.setType(DestinationType.QUEUE); return rc; case ActiveMQDestination.TOPIC_TYPE: rc.setType(DestinationType.TOPIC); return rc; case ActiveMQDestination.TEMP_QUEUE_TYPE: rc.setType(DestinationType.TEMP_QUEUE); return rc; case ActiveMQDestination.TEMP_TOPIC_TYPE: rc.setType(DestinationType.TEMP_TOPIC); return rc; default: return null; } }
public static KahaDestination parseFramed(org.apache.activemq.protobuf.Buffer data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException { return new KahaDestination().mergeFramed(data).checktInitialized(); }
public static KahaDestination parseUnframed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException { return new KahaDestination().mergeUnframed(data).checktInitialized(); }
public java.util.ArrayList<String> missingFields() { java.util.ArrayList<String> missingFields = super.missingFields(); if( !hasDestination() ) { missingFields.add("destination"); } if( hasDestination() ) { try { getDestination().assertInitialized(); } catch (org.apache.activemq.protobuf.UninitializedMessageException e){ missingFields.addAll(prefix(e.getMissingFields(),"destination.")); } } return missingFields; }
public boolean equals(Object obj) { if( obj==this ) return true; if( obj==null || obj.getClass()!=KahaDestination.class ) return false; return equals((KahaDestination)obj); }
public KahaDestination getDestination() { if( this.f_destination == null ) { this.f_destination = new KahaDestination(); } return this.f_destination; }
protected StoredDestination getStoredDestination(KahaDestination destination, Transaction tx) throws IOException { String key = key(destination); StoredDestination rc = storedDestinations.get(key); if (rc == null) { boolean topic = destination.getType() == KahaDestination.DestinationType.TOPIC || destination.getType() == KahaDestination.DestinationType.TEMP_TOPIC; rc = loadStoredDestination(tx, key, topic); // Cache it. We may want to remove/unload destinations from the // cache that are not used for a while // to reduce memory usage. storedDestinations.put(key, rc); } return rc; }
@Override public void run() { this.store.doneTasks++; try { if (this.done.compareAndSet(false, true)) { this.store.addMessage(context, message); removeQueueTask(this.store, this.message.getMessageId()); this.future.complete(); } else if (cancelledTaskModMetric > 0 && (++this.store.canceledTasks) % cancelledTaskModMetric == 0) { System.err.println(this.store.dest.getName() + " cancelled: " + (this.store.canceledTasks / this.store.doneTasks) * 100); this.store.canceledTasks = this.store.doneTasks = 0; } } catch (Throwable t) { this.future.setException(t); removeQueueTask(this.store, this.message.getMessageId()); } }
public static KahaDestination parseFramed(org.apache.activemq.protobuf.CodedInputStream data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException, java.io.IOException { return new KahaDestination().mergeFramed(data).checktInitialized(); }
public static KahaDestination parseUnframed(byte[] data) throws org.apache.activemq.protobuf.InvalidProtocolBufferException { return new KahaDestination().mergeUnframed(data).checktInitialized(); }