/** * When we have finished a <code>declarable</code>, instantiate an instance * of the {@link Declarable}and push it on the stack. */ private void endDeclarable() { Declarable d = createDeclarable(); stack.push(d); }
/** * When we have finished a <code>declarable</code>, instantiate an instance * of the {@link Declarable}and push it on the stack. */ private void endDeclarable() { Declarable d = createDeclarable(); stack.push(d); }
private void endCustomExpiry() { Declarable d = createDeclarable(); if (!(d instanceof CustomExpiry)) { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_CUSTOMEXPIRY.toLocalizedString(d.getClass().getName())); } stack.push(d); }
private void endCustomExpiry() { Declarable d = createDeclarable(); if (!(d instanceof CustomExpiry)) { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_CUSTOMEXPIRY.toLocalizedString(d.getClass().getName())); } stack.push(d); }
/** * Create a <code>transaction-writer</code> using the declarable interface * and set the transaction manager with the newly instantiated writer. */ private void endTransactionWriter() { Declarable d = createDeclarable(); if (!(d instanceof TransactionWriter)) { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_A_TRANSACTION_WRITER.toLocalizedString(d.getClass().getName())); } CacheTransactionManagerCreation txMgrCreation = (CacheTransactionManagerCreation) stack .peek(); txMgrCreation.setWriter((TransactionWriter) d); }
/** * */ private void endPdxSerializer() { Declarable d = createDeclarable(); if (!(d instanceof PdxSerializer)) { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_A_PDX_SERIALIZER.toLocalizedString(d.getClass().getName())); } PdxSerializer serializer = (PdxSerializer) d; this.cache.setPdxSerializer(serializer); }
/** * Create a <code>transaction-listener</code> using the declarable interface * and set the transaction manager with the newly instantiated listener. */ private void endTransactionListener() { Declarable d = createDeclarable(); if (!(d instanceof TransactionListener)) { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_A_CACHELISTENER.toLocalizedString(d.getClass().getName())); } CacheTransactionManagerCreation txMgrCreation = (CacheTransactionManagerCreation) stack .peek(); txMgrCreation.addListener((TransactionListener) d); }
/** * Create a <code>transaction-writer</code> using the declarable interface * and set the transaction manager with the newly instantiated writer. */ private void endTransactionWriter() { Declarable d = createDeclarable(); if (!(d instanceof TransactionWriter)) { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_A_TRANSACTION_WRITER.toLocalizedString(d.getClass().getName())); } CacheTransactionManagerCreation txMgrCreation = (CacheTransactionManagerCreation) stack .peek(); txMgrCreation.setWriter((TransactionWriter) d); }
/** * Create a <code>transaction-listener</code> using the declarable interface * and set the transaction manager with the newly instantiated listener. */ private void endTransactionListener() { Declarable d = createDeclarable(); if (!(d instanceof TransactionListener)) { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_A_CACHELISTENER.toLocalizedString(d.getClass().getName())); } CacheTransactionManagerCreation txMgrCreation = (CacheTransactionManagerCreation) stack .peek(); txMgrCreation.addListener((TransactionListener) d); }
/** * When a <code>gateway-listener</code> element is encountered, * create a new listener for the current <code>Gateway</code>. * * @since 5.1 */ private void endGatewayListener() { Declarable d = createDeclarable(); if (!(d instanceof GatewayEventListener)) { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_A_GATEWAYEVENTLISTENER.toLocalizedString(d.getClass().getName())); } Gateway gateway = (Gateway) stack.peek(); gateway.addListener((GatewayEventListener) d); }
/** * When a <code>gateway-conflict-resolver</code> element is encountered, * create a new listener for the <code>Cache</code>. * @since 7.0 */ private void endGatewayConflictResolver() { Declarable d = createDeclarable(); if (!(d instanceof GatewayConflictResolver)) { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_A_GATEWAYCONFLICTRESOLVER.toLocalizedString(d.getClass().getName())); } CacheCreation c = (CacheCreation)stack.peek(); c.setGatewayConflictResolver((GatewayConflictResolver)d); // this.cache.setGatewayConflictResolver((GatewayConflictResolver)d); }
/** * */ private void endPdxSerializer() { Declarable d = createDeclarable(); if (!(d instanceof PdxSerializer)) { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_A_PDX_SERIALIZER.toLocalizedString(d.getClass().getName())); } PdxSerializer serializer = (PdxSerializer) d; this.cache.setPdxSerializer(serializer); }
private void endAsyncEventListener() { Declarable d = createDeclarable(); if (!(d instanceof AsyncEventListener)) { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_A_ASYNCEVENTLISTENER.toLocalizedString(d.getClass().getName())); } AsyncEventQueueCreation eventChannel = peekAsyncEventQueueContext(ASYNC_EVENT_LISTENER); eventChannel.setAsyncEventListener((AsyncEventListener) d); }
private void endGatewayEventFilter() { Declarable d = createDeclarable(); if (!(d instanceof GatewayEventFilter)) { throw new CacheXmlException( LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_A_1 .toLocalizedString(new Object[] { d.getClass().getName(), "GatewayEventFilter"})); } GatewaySenderFactory senderFactory = peekGatewaySender(GATEWAY_EVENT_FILTER); senderFactory.addGatewayEventFilter((GatewayEventFilter)d); }
private void endAsyncEventListener() { Declarable d = createDeclarable(); if (!(d instanceof AsyncEventListener)) { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_A_ASYNCEVENTLISTENER.toLocalizedString(d.getClass().getName())); } AsyncEventQueueCreation eventChannel = peekAsyncEventQueueContext(ASYNC_EVENT_LISTENER); eventChannel.setAsyncEventListener((AsyncEventListener) d); }
/** * When a <code>cache-listener</code> element is finished, the {@link * Parameter}s and class names are popped off the stack. The cache listener is * instantiated and initialized with the parameters, if appropriate. */ private void endCacheListener() { Declarable d = createDeclarable(); if (!(d instanceof CacheListener)) { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_A_CACHELISTENER.toLocalizedString(d.getClass().getName())); } RegionAttributesCreation attrs = peekRegionAttributesContext(CACHE_LISTENER); attrs.addCacheListener((CacheListener) d); }
/** * When a <code>cache-listener</code> element is finished, the {@link * Parameter}s and class names are popped off the stack. The cache listener is * instantiated and initialized with the parameters, if appropriate. */ private void endCacheListener() { Declarable d = createDeclarable(); if (!(d instanceof CacheListener)) { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_A_CACHELISTENER.toLocalizedString(d.getClass().getName())); } RegionAttributesCreation attrs = peekRegionAttributesContext(CACHE_LISTENER); attrs.addCacheListener((CacheListener) d); }
/** * When a <code>partition-resolver</code> element is finished, the {@link * Parameter}s and class names are popped off the stack. The * <code>PartitionResolver</code> is instantiated and initialized with the * parameters, if appropriate. */ private void endPartitionResolver() { Declarable d = createDeclarable(); if (!(d instanceof PartitionResolver)) { throw new CacheXmlException( LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_A_1 .toLocalizedString(new Object[] { d.getClass().getName(), "PartitionResolver"})); } PartitionAttributesImpl pai = peekPartitionAttributesImpl(PARTITION_ATTRIBUTES); pai.setPartitionResolver((PartitionResolver) d); }
/** * When a <code>partition-listener</code> element is finished, the {@link * Parameter}s and class names are popped off the stack. The * <code>PartitionListener</code> is instantiated and initialized with the * parameters, if appropriate. */ private void endPartitionListener() { Declarable d = createDeclarable(); if (!(d instanceof PartitionListener)) { throw new CacheXmlException( LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_A_1 .toLocalizedString(new Object[] { d.getClass().getName(), "PartitionListener"})); } PartitionAttributesImpl pai = peekPartitionAttributesImpl(PARTITION_ATTRIBUTES); pai.addPartitionListener((PartitionListener) d); }
/** * When a <code>partition-listener</code> element is finished, the {@link * Parameter}s and class names are popped off the stack. The * <code>PartitionListener</code> is instantiated and initialized with the * parameters, if appropriate. */ private void endPartitionListener() { Declarable d = createDeclarable(); if (!(d instanceof PartitionListener)) { throw new CacheXmlException( LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_A_1 .toLocalizedString(new Object[] { d.getClass().getName(), "PartitionListener"})); } PartitionAttributesImpl pai = peekPartitionAttributesImpl(PARTITION_ATTRIBUTES); pai.addPartitionListener((PartitionListener) d); }