예제 #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: void perform(io.netty.channel.ChannelHandlerContext ctx) throws java.io.IOException
        internal virtual void Perform(ChannelHandlerContext ctx)
        {
            CheckPointer checkPointer   = _checkPointerSupplier.get();
            Resource     checkPointLock = _mutex.storeCopy(() => checkPointer.TryCheckPoint(new SimpleTriggerInfo("Store copy")));

            Future <Void> completion = null;

            try
            {
                using (RawCursor <StoreResource, IOException> resources = _resourceStreamFactory.create())
                {
                    while (resources.Next())
                    {
                        StoreResource resource = resources.get();
                        _protocol.stream(ctx, resource);
                    }
                    completion = _protocol.end(ctx, SUCCESS);
                }
            }
            finally
            {
                if (completion != null)
                {
                    completion.addListener(f => checkPointLock.close());
                }
                else
                {
                    checkPointLock.Close();
                }
            }
        }
예제 #2
0
 public override void Close()
 {
     if (_resource != null)
     {
         _resource.close();
         _resource = null;
     }
 }
예제 #3
0
 protected internal AbstractTraverserIterator(Resource resource)
 {
     this._resource = resource;
 }