Java 类org.apache.camel.api.management.ManagedOperation 实例源码

项目:Camel    文件:RedisStringIdempotentRepository.java   
@ManagedOperation(description = "Clear the store")
@Override
public void clear() {
    valueOperations.getOperations().execute(new RedisCallback<List<byte[]>>() {
        @Override
        public List<byte[]> doInRedis(RedisConnection connection) throws DataAccessException {
            List<byte[]> binaryKeys = new ArrayList<>();
            Cursor<byte[]> cursor = connection.scan(ScanOptions.scanOptions().match("*" + createRedisKey("*")).build());

            while (cursor.hasNext()) {
                byte[] key = cursor.next();
                binaryKeys.add(key);
            }
            if (binaryKeys.size() > 0) {
                connection.del(binaryKeys.toArray(new byte[][]{}));
            }
            return binaryKeys;
        }
    });
}
项目:Camel    文件:AbstractJdbcMessageIdRepository.java   
@ManagedOperation(description = "Does the store contain the given key")
@Override
public boolean contains(final T key) {
    // Run this in single transaction.
    Boolean rc = transactionTemplate.execute(new TransactionCallback<Boolean>() {
        public Boolean doInTransaction(TransactionStatus status) {
            int count = queryForInt(key);
            if (count == 0) {
                return Boolean.FALSE;
            } else {
                return Boolean.TRUE;
            }
        }
    });
    return rc.booleanValue();

}
项目:Camel    文件:JpaMessageIdRepository.java   
@ManagedOperation(description = "Clear the store")
public void clear() {
    final EntityManager entityManager = getTargetEntityManager(null, entityManagerFactory, true, sharedEntityManager, true);

    Boolean rc = transactionTemplate.execute(new TransactionCallback<Boolean>() {
        public Boolean doInTransaction(TransactionStatus status) {
            if (isJoinTransaction()) {
                entityManager.joinTransaction();
            }

            List<?> list = queryClear(entityManager);
            if (!list.isEmpty()) {
                Iterator it = list.iterator();
                while (it.hasNext()) {
                    Object item = it.next();
                    entityManager.remove(item);
                }
                entityManager.flush();
            }
            return Boolean.TRUE;
        }
    });

    LOG.debug("clear the store {}", MessageProcessed.class.getName());        
}
项目:Camel    文件:AbstractJdbcMessageIdRepository.java   
@ManagedOperation(description = "Clear the store")
@Override
public void clear() {
    transactionTemplate.execute(new TransactionCallback<Boolean>() {
        public Boolean doInTransaction(TransactionStatus status) {
            delete();
            return Boolean.TRUE;
        }
    });
}
项目:Camel    文件:MongoDbIdempotentRepository.java   
@ManagedOperation(description = "Remove the key from the store")
@Override
public boolean remove(E key) {
    Document document = new Document("_id", key);
    DeleteResult res = collection.deleteOne(document);
    return  res.getDeletedCount() > 0;
}
项目:Camel    文件:RedisIdempotentRepository.java   
@ManagedOperation(description = "Adds the key to the store")
public boolean add(String key) {
    if (!contains(key)) { 
        return setOperations.add(processorName, key) != null;
    } else {
        return false;
    }
}
项目:Camel    文件:ManagedProducerCacheMBean.java   
@ManagedOperation(description = "Reset cache statistics")
void resetStatistics();
项目:Camel    文件:ManagedProducerCacheMBean.java   
@ManagedOperation(description = "Purges the cache")
void purge();
项目:Camel    文件:HystrixEventStreamService.java   
@ManagedOperation(description = "Pauses the metrics poller")
public void pausePoller() {
    poller.pause();
}
项目:Camel    文件:ManagedRecipientListMBean.java   
@ManagedOperation(description = "Statistics of the endpoints which has been sent to")
TabularData extendedInformation();
项目:Camel    文件:SedaEndpoint.java   
/**
 * Purges the queue
 */
@ManagedOperation(description = "Purges the seda queue")
public void purgeQueue() {
    LOG.debug("Purging queue with {} exchanges", queue.size());
    queue.clear();
}
项目:Camel    文件:ResourceEndpoint.java   
@ManagedOperation(description = "Clears the cached resource, forcing to re-load the resource on next request")
public void clearContentCache() {
    log.debug("Clearing resource: {} from the content cache", resourceUri);
    buffer = null;
}
项目:Camel    文件:ManagedCircuitBreakerLoadBalancerMBean.java   
@ManagedOperation(description = "Dumps the state of the load balancer")
String dumpState();
项目:Camel    文件:ManagedConsumerCacheMBean.java   
@ManagedOperation(description = "Purges the cache")
void purge();
项目:Camel    文件:ManagedChoiceMBean.java   
@ManagedOperation(description = "Statistics of the content based router for each predicate")
TabularData choiceStatistics();
项目:Camel    文件:ManagedRuntimeEndpointRegistryMBean.java   
@ManagedOperation(description = "Reset the statistic counters")
void reset();
项目:Camel    文件:ManagedFailoverLoadBalancerMBean.java   
@ManagedOperation(description = "Statistics of the content based router for each exception")
TabularData exceptionStatistics();
项目:Camel    文件:ManagedAsyncProcessorAwaitManagerMBean.java   
@ManagedOperation(description = "To interrupt an exchange which may seem as stuck, to force the exchange to continue, allowing any blocking thread to be released.")
void interrupt(String exchangeId);
项目:Camel    文件:ManagedAsyncProcessorAwaitManagerMBean.java   
@ManagedOperation(description = "Resets the statistics")
void resetStatistics();
项目:Camel    文件:ManagedSendDynamicProcessorMBean.java   
@ManagedOperation(description = "Statistics of the endpoints which has been sent to")
TabularData extendedInformation();
项目:Camel    文件:ManagedCamelContextMBean.java   
@ManagedOperation(description = "Dumps the routes as XML")
String dumpRoutesAsXml() throws Exception;
项目:Camel    文件:ManagedEndpointMBean.java   
@ManagedOperation(description = "Explain how this endpoint is configured")
TabularData explain(boolean allOptions);
项目:Camel    文件:ManagedCamelContextMBean.java   
@ManagedOperation(description = "Starts all the routes which currently is not started")
void startAllRoutes() throws Exception;
项目:Camel    文件:ManagedInflightRepositoryMBean.java   
@ManagedOperation(description = "Current size of inflight exchanges which are from the given route.")
int size(String routeId);
项目:Camel    文件:ManagedInflightRepositoryMBean.java   
@ManagedOperation(description = "Lists all the exchanges which are currently inflight")
TabularData browse();
项目:Camel    文件:ManagedInflightRepositoryMBean.java   
@ManagedOperation(description = "List all the exchanges that origins from the given route, which are currently inflight, limited and sorted")
TabularData browse(String fromRouteId, int limit, boolean sortByLongestDuration);
项目:Camel    文件:ManagedPerformanceCounterMBean.java   
@ManagedOperation(description = "Dumps the statistics as XML")
String dumpStatsAsXml(boolean fullStats);
项目:Camel    文件:ManagedProcessorMBean.java   
@ManagedOperation(description = "Start Processor")
void start() throws Exception;
项目:Camel    文件:ManagedProcessorMBean.java   
@ManagedOperation(description = "Stop Processor")
void stop() throws Exception;
项目:Camel    文件:ManagedCamelContextMBean.java   
@ManagedOperation(description = "Whether its possible to send to the endpoint (eg the endpoint has a producer)")
boolean canSendToEndpoint(String endpointUri);
项目:Camel    文件:MetricsRegistryMBean.java   
@ManagedOperation(description = "Dumps the statistics as json")
String dumpStatisticsAsJson();
项目:Camel    文件:ManagedIdempotentConsumerMBean.java   
@ManagedOperation(description = "Reset the current count of duplicate Messages")
void resetDuplicateMessageCount();
项目:Camel    文件:JpaMessageIdRepository.java   
@ManagedOperation(description = "Adds the key to the store")
public boolean add(String messageId) {
    return add(null, messageId);
}
项目:Camel    文件:ZooKeeperEndpoint.java   
@ManagedOperation
public void clearServers() {
    getConfiguration().getServers().clear();
}
项目:Camel    文件:ManagedStreamCachingStrategyMBean.java   
@ManagedOperation(description = "Reset the utilization statistics")
void resetStatistics();
项目:Camel    文件:ValidatorEndpoint.java   
@ManagedOperation(description = "Clears the cached schema, forcing to re-load the schema on next request")
public void clearCachedSchema() {

    schemaReader.setSchema(null); // will cause to reload the schema
}
项目:Camel    文件:ManagedRouteMBean.java   
@ManagedOperation(description = "Stop route")
void stop() throws Exception;
项目:Camel    文件:ManagedRuntimeEndpointRegistryMBean.java   
@ManagedOperation(description = " Gets all the endpoint urls captured during runtime that are in-use")
List<String> getAllEndpoints(boolean includeInputs);
项目:Camel    文件:ManagedCamelContextMBean.java   
@ManagedOperation(description = "Restart Camel (stop and then start)")
void restart() throws Exception;
项目:Camel    文件:ManagedCamelContextMBean.java   
@ManagedOperation(description = "Adds or updates existing routes from XML")
void addOrUpdateRoutesFromXml(String xml) throws Exception;