@@ -0,0 +1,2651 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.apache.qpid.proton4j.engine.impl;%0A%0Aimport org.apache.qpid.proton4j.amqp.transactions.Declare;%0Aimport org.apache.qpid.proton4j.amqp.transactions.Declared;%0Aimport org.apache.qpid.proton4j.amqp.transactions.Discharge;%0Aimport org.apache.qpid.proton4j.amqp.transport.Role;%0Aimport org.apache.qpid.proton4j.engine.AsyncEvent;%0Aimport org.apache.qpid.proton4j.engine.EventHandler;%0A%0A/**%0A * Proton Coordinator link implementation.%0A */%0Apublic class ProtonCoordinator extends ProtonLink%3CProtonCoordinator%3E %7B%0A%0A    // TODO - Should be two ends of a coordinator, sender and receiver%0A    //        one side drives the declare and discharge and the other%0A    //        handles those requests for TX boundaries.%0A%0A    protected ProtonCoordinator(ProtonSession session, String name) %7B%0A        super(session, name);%0A    %7D%0A%0A    @Override%0A    public int getCredit() %7B%0A        // TODO Auto-generated method stub%0A        return 0;%0A    %7D%0A%0A    @Override%0A    public Role getRole() %7B%0A        return Role.SENDER;%0A    %7D%0A%0A    @Override%0A    protected ProtonCoordinator self() %7B%0A        return this;%0A    %7D%0A%0A    @Override%0A    protected ProtonLinkCreditState%3C?%3E getCreditState() %7B%0A        // TODO Auto-generated method stub%0A        return null;%0A    %7D%0A%0A    public void declare(byte%5B%5D txnId) %7B%0A%0A    %7D%0A%0A    public void discharge(byte%5B%5D txnId, boolean failed) %7B%0A%0A    %7D%0A%0A    // TODO - Possible event points to handle declare of a TX and the response, and the discharge of a TX%0A%0A    public ProtonCoordinator declareHandler(EventHandler%3CAsyncEvent%3CDeclare%3E%3E remoteDeclareHandler) %7B%0A        return this;%0A    %7D%0A%0A    public ProtonCoordinator declaredHandler(EventHandler%3CAsyncEvent%3CDeclared%3E%3E remoteDeclaredHandler) %7B%0A        return this;%0A    %7D%0A%0A    public ProtonCoordinator dischargeHandler(EventHandler%3CAsyncEvent%3CDischarge%3E%3E remoteDischargeHandler) %7B%0A        return this;%0A    %7D%0A%7D%0A

Add some initial thoughts on simplifying the transaction API