http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/engine/src/org/apache/qpid/proton/engine/impl/ArraySequence.java ---------------------------------------------------------------------- diff --git a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/ArraySequence.java b/proton-j/engine/src/org/apache/qpid/proton/engine/impl/ArraySequence.java deleted file mode 100644 index 44bf71f..0000000 --- a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/ArraySequence.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.engine.impl; - -import org.apache.qpid.proton.engine.Sequence; - -public class ArraySequence<E> implements Sequence<E> -{ - private final E[] _elements; - private int _pos; - - public ArraySequence(E... elements) - { - _elements = elements; - _pos = 0; - } - - public E next() - { - if(_pos>_elements.length) - { - return null; - } - - return _elements[_pos++]; - } -}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/engine/src/org/apache/qpid/proton/engine/impl/ConcatenatedSequence.java ---------------------------------------------------------------------- diff --git a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/ConcatenatedSequence.java b/proton-j/engine/src/org/apache/qpid/proton/engine/impl/ConcatenatedSequence.java deleted file mode 100644 index 47adb0a..0000000 --- a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/ConcatenatedSequence.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.engine.impl; - -import org.apache.qpid.proton.engine.Sequence; - -public class ConcatenatedSequence<E> implements Sequence<E> -{ - private final Sequence<Sequence<E>> _sequences; - private Sequence<E> _currentSequence; - - public ConcatenatedSequence(Sequence<E>... sequences) - { - this(new ArraySequence<Sequence<E>>(sequences)); - } - - public ConcatenatedSequence(Sequence<Sequence<E>> sequences) - { - _sequences = sequences; - _currentSequence = sequences.next(); - } - - public E next() - { - if(_currentSequence == null) - { - return null; - } - E next = _currentSequence.next(); - if(next == null && (_currentSequence = _sequences.next()) != null) - { - next = _currentSequence.next(); - } - return next; - } -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/engine/src/org/apache/qpid/proton/engine/impl/ConnectionImpl.java ---------------------------------------------------------------------- diff --git a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/ConnectionImpl.java b/proton-j/engine/src/org/apache/qpid/proton/engine/impl/ConnectionImpl.java deleted file mode 100644 index 518c385..0000000 --- a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/ConnectionImpl.java +++ /dev/null @@ -1,333 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine.impl; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import org.apache.qpid.proton.engine.Connection; -import org.apache.qpid.proton.engine.EndpointState; -import org.apache.qpid.proton.engine.Sequence; -import org.apache.qpid.proton.engine.Session; -import org.apache.qpid.proton.engine.Transport; -import org.apache.qpid.proton.type.transport.Open; - -public class ConnectionImpl extends EndpointImpl implements Connection -{ - - public static final int MAX_CHANNELS = 255; - private TransportFactory _transportFactory = TransportFactory.getDefaultTransportFactory(); - private TransportImpl _transport; - private List<SessionImpl> _sessions = new ArrayList<SessionImpl>(); - private EndpointImpl _transportTail; - private EndpointImpl _transportHead; - private int _maxChannels = MAX_CHANNELS; - private EndpointImpl _tail; - private EndpointImpl _head; - - private DeliveryImpl _workHead; - private DeliveryImpl _workTail; - - private DeliveryImpl _transportWorkHead; - private DeliveryImpl _transportWorkTail; - - public ConnectionImpl() - { - _transportFactory = TransportFactory.getDefaultTransportFactory(); - _head = this; - _tail = this; - } - - public SessionImpl session() - { - SessionImpl session = new SessionImpl(this); - _sessions.add(session); - addEndpoint(session); - return session; - } - - protected void addEndpoint(EndpointImpl endpoint) - { - endpoint.setPrev(_tail); - _tail.setNext(endpoint); - _tail = endpoint; - } - - protected void removeEndpoint(EndpointImpl endpoint) - { - if(endpoint == _tail) - { - _tail = endpoint.getPrev(); - } - if(endpoint == _head) - { - _head = endpoint.getNext(); - } - - } - - public Transport transport() - { - if(_transport == null) - { - _transport = (TransportImpl) _transportFactory.transport(this); - addEndpoint(_transport); - } - else - { - // todo - should error - - } - return _transport; - } - - public Sequence<? extends EndpointImpl> endpoints(final EnumSet<EndpointState> local, - final EnumSet<EndpointState> remote) - { - return new EndpointSelectionSequence<EndpointImpl>(local, remote, new EndpointSequence(this)); - } - - @Override - protected ConnectionImpl getConnectionImpl() - { - return this; - } - - public void destroy() - { - super.destroy(); - for(Session session : _sessions) - { - session.destroy(); - } - _sessions = null; - if(_transport != null) - { - _transport.destroy(); - } - } - - void clearTransport() - { - removeEndpoint(_transport); - _transport = null; - } - - public void handleOpen(Open open) - { - // TODO - store state - setRemoteState(EndpointState.ACTIVE); - } - - - EndpointImpl getTransportHead() - { - return _transportHead; - } - - EndpointImpl getTransportTail() - { - return _transportTail; - } - - void addModified(EndpointImpl endpoint) - { - if(_transportTail == null) - { - _transportHead = _transportTail = endpoint; - } - else - { - _transportTail.setTransportNext(endpoint); - endpoint.setTransportPrev(_transportTail); - _transportTail = endpoint; - } - } - - void removeModified(EndpointImpl endpoint) - { - if(_transportHead == endpoint) - { - _transportHead = endpoint.transportNext(); - } - else - { - endpoint.transportPrev().setTransportNext(endpoint.transportNext()); - } - - if(_transportTail == endpoint) - { - _transportTail = endpoint.transportPrev(); - } - else - { - endpoint.transportNext().setTransportPrev(endpoint.transportPrev()); - } - } - - public int getMaxChannels() - { - return _maxChannels; - } - - public EndpointImpl next() - { - return getNext(); - } - - - private static class EndpointSequence implements Sequence<EndpointImpl> - { - private EndpointImpl _current; - - public EndpointSequence(ConnectionImpl connection) - { - _current = connection; - } - - - public EndpointImpl next() - { - EndpointImpl next = _current; - if(next != null) - { - _current = next.getNext(); - } - return next; - } - } - - DeliveryImpl getWorkHead() - { - return _workHead; - } - - DeliveryImpl getWorkTail() - { - return _workTail; - } - - void removeWork(DeliveryImpl delivery) - { - if(_workHead == delivery) - { - _workHead = delivery.getWorkNext(); - - } - if(_workTail == delivery) - { - _workTail = delivery.getWorkPrev(); - } - } - - void addWork(DeliveryImpl delivery) - { - if(_workHead != delivery && delivery.getWorkNext() == null && delivery.getWorkPrev() == null) - { - if(_workTail == null) - { - _workHead = _workTail = delivery; - } - else - { - _workTail.setWorkNext(delivery); - delivery.setWorkPrev(_workTail); - _workTail = delivery; - } - } - } - - public Sequence<DeliveryImpl> getWorkSequence() - { - return new WorkSequence(_workHead); - } - - private class WorkSequence implements Sequence<DeliveryImpl> - { - private DeliveryImpl _next; - - public WorkSequence(DeliveryImpl workHead) - { - _next = workHead; - } - - public DeliveryImpl next() - { - DeliveryImpl next = _next; - if(next != null) - { - _next = next.getWorkNext(); - } - return next; - } - } - - DeliveryImpl getTransportWorkHead() - { - return _transportWorkHead; - } - - public void removeTransportWork(DeliveryImpl delivery) - { - DeliveryImpl oldHead = _transportWorkHead; - DeliveryImpl oldTail = _transportWorkTail; - if(_transportWorkHead == delivery) - { - _transportWorkHead = delivery.getTransportWorkNext(); - - } - if(_transportWorkTail == delivery) - { - _transportWorkTail = delivery.getTransportWorkPrev(); - } - } - - - void addTransportWork(DeliveryImpl delivery) - { - if(_transportWorkTail == null) - { - _transportWorkHead = _transportWorkTail = delivery; - } - else - { - _transportWorkTail.setTransportWorkNext(delivery); - delivery.setTransportWorkPrev(_transportWorkTail); - _transportWorkTail = delivery; - } - } - - void workUpdate(DeliveryImpl delivery) - { - if(delivery != null) - { - LinkImpl link = delivery.getLink(); - if(link.workUpdate(delivery)) - { - addWork(delivery); - } - else - { - delivery.clearWork(); - } - } - } -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/engine/src/org/apache/qpid/proton/engine/impl/DeliveryImpl.java ---------------------------------------------------------------------- diff --git a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/DeliveryImpl.java b/proton-j/engine/src/org/apache/qpid/proton/engine/impl/DeliveryImpl.java deleted file mode 100644 index 75dfe1d..0000000 --- a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/DeliveryImpl.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine.impl; - -import org.apache.qpid.proton.engine.Delivery; -import org.apache.qpid.proton.engine.DeliveryState; - -public class DeliveryImpl implements Delivery -{ - private DeliveryImpl _linkPrevious; - private DeliveryImpl _linkNext; - - private DeliveryImpl _workNext; - private DeliveryImpl _workPrev; - - private DeliveryImpl _transportWorkNext; - private DeliveryImpl _transportWorkPrev; - - - - private final byte[] _tag; - private final LinkImpl _link; - private DeliveryState _deliveryState; - private boolean _settled; - private boolean _remoteSettled; - private DeliveryState _remoteDeliveryState; - - private static final int DELIVERY_STATE_CHANGED = 1; - private static final int ABLE_TO_SEND = 2; - private static final int IO_WORK = 4; - - private int _flags = (byte) 0; - private int _transportFlags = (byte) 0; - private TransportDelivery _transportDelivery; - - public DeliveryImpl(final byte[] tag, final LinkImpl link, DeliveryImpl previous) - { - _tag = tag; - _link = link; - _linkPrevious = previous; - if(previous != null) - { - previous._linkNext = this; - } - } - - public byte[] getTag() - { - return _tag; - } - - public LinkImpl getLink() - { - return _link; - } - - public DeliveryState getLocalState() - { - return _deliveryState; - } - - public DeliveryState getRemoteState() - { - return _remoteDeliveryState; - } - - public boolean remotelySettled() - { - return _remoteSettled; - } - - public int getMessageFormat() - { - return 0; - } - - public void disposition(final DeliveryState state) - { - _deliveryState = state; - setTransportFlag(DELIVERY_STATE_CHANGED); - - } - - public void settle() - { - _settled = true; - } - - DeliveryImpl getLinkNext() - { - return _linkNext; - } - - public void destroy() - { - _link.remove(this); - if(_linkPrevious != null) - { - _linkPrevious._linkNext = _linkNext; - } - if(_linkNext != null) - { - _linkNext._linkPrevious = _linkPrevious; - } - } - - DeliveryImpl getLinkPrevious() - { - return _linkPrevious; - } - - DeliveryImpl getWorkNext() - { - return _workNext; - } - - DeliveryImpl getWorkPrev() - { - return _workPrev; - } - - - void setWorkNext(DeliveryImpl workNext) - { - _workNext = workNext; - } - - void setWorkPrev(DeliveryImpl workPrev) - { - _workPrev = workPrev; - } - - int recv(byte[] bytes, int offset, int size) - { - - //TODO - should only be if no bytes left - clearFlag(IO_WORK); - return -1; //TODO - Implement - } - - private void clearFlag(int ioWork) - { - _flags = _flags & (~IO_WORK); - if(_flags == 0) - { - clearWork(); - } - } - - void clearWork() - { - getLink().getConnectionImpl().removeWork(this); - if(_workPrev != null) - { - _workPrev.setWorkNext(_workNext); - } - if(_workNext != null) - { - _workNext.setWorkPrev(_workPrev); - - } - _workNext = null; - _workPrev = null; - } - - void addToWorkList() - { - getLink().getConnectionImpl().addWork(this); - } - - void addIOWork() - { - setFlag(IO_WORK); - } - - private void setFlag(int flag) - { - boolean addWork; - if(flag == IO_WORK && (_flags & flag) == 0) - { - clearWork(); - addWork = true; - } - else - { - addWork = (_flags == 0); - } - _flags = _flags | flag; - if(addWork) - { - addToWorkList(); - } - } - - - private void clearTransportFlag(int ioWork) - { - _flags = _flags & (~IO_WORK); - if(_flags == 0) - { - clearTransportWork(); - } - } - - void clearTransportWork() - { - getLink().getConnectionImpl().removeTransportWork(this); - if(_transportWorkPrev != null) - { - _transportWorkPrev.setTransportWorkNext(_transportWorkNext); - } - if(_transportWorkNext != null) - { - _transportWorkNext.setTransportWorkPrev(_transportWorkPrev); - - } - _transportWorkNext = null; - _transportWorkPrev = null; - } - - void addToTransportWorkList() - { - getLink().getConnectionImpl().addTransportWork(this); - } - - - private void setTransportFlag(int flag) - { - boolean addWork = (_transportFlags == 0); - _transportFlags = _transportFlags | flag; - if(addWork) - { - addToTransportWorkList(); - } - } - - DeliveryImpl getTransportWorkNext() - { - return _transportWorkNext; - } - - - DeliveryImpl getTransportWorkPrev() - { - return _transportWorkPrev; - } - - void setTransportWorkNext(DeliveryImpl transportWorkNext) - { - _transportWorkNext = transportWorkNext; - } - - void setTransportWorkPrev(DeliveryImpl transportWorkPrev) - { - _transportWorkPrev = transportWorkPrev; - } - - boolean isLocalStateChange() - { - return (_transportFlags & DELIVERY_STATE_CHANGED) != 0; - } - - TransportDelivery getTransportDelivery() - { - return _transportDelivery; - } - - void setTransportDelivery(TransportDelivery transportDelivery) - { - _transportDelivery = transportDelivery; - } - - public boolean isSettled() - { - return _settled; - } -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/engine/src/org/apache/qpid/proton/engine/impl/EndpointImpl.java ---------------------------------------------------------------------- diff --git a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/EndpointImpl.java b/proton-j/engine/src/org/apache/qpid/proton/engine/impl/EndpointImpl.java deleted file mode 100644 index 8b5517c..0000000 --- a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/EndpointImpl.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.engine.impl; - -import org.apache.qpid.proton.engine.Endpoint; -import org.apache.qpid.proton.engine.EndpointError; -import org.apache.qpid.proton.engine.EndpointState; - -public abstract class EndpointImpl implements Endpoint -{ - private EndpointState _localState = EndpointState.UNINITIALIZED; - private EndpointState _remoteState; - private EndpointError _localError; - private EndpointError _remoteError; - private boolean _modified; - private EndpointImpl _next; - private EndpointImpl _prev; - private EndpointImpl _transportNext; - private EndpointImpl _transportPrev; - - - public void open() - { - switch(_localState) - { - case ACTIVE: - // TODO - case CLOSED: - // TODO - case UNINITIALIZED: - _localState = EndpointState.ACTIVE; - } - } - - public void close() - { - - switch(_localState) - { - case UNINITIALIZED: - // TODO - case CLOSED: - // TODO - case ACTIVE: - _localState = EndpointState.CLOSED; - } - } - - public EndpointState getLocalState() - { - return _localState; - } - - public EndpointState getRemoteState() - { - return _remoteState; - } - - public EndpointError getLocalError() - { - return _localError; - } - - public EndpointError getRemoteError() - { - return _remoteError; - } - - void setLocalState(EndpointState localState) - { - _localState = localState; - } - - void setRemoteState(EndpointState remoteState) - { - // TODO - check state change legal - _remoteState = remoteState; - } - - void setLocalError(EndpointError localError) - { - _localError = localError; - } - - void setRemoteError(EndpointError remoteError) - { - _remoteError = remoteError; - } - - void modified() - { - if(!_modified) - { - _modified = true; - getConnectionImpl().addModified(this); - } - } - - protected abstract ConnectionImpl getConnectionImpl(); - - void clearModified() - { - if(_modified) - { - _modified = false; - getConnectionImpl().removeModified(this); - } - } - - boolean isModified() - { - return _modified; - } - - EndpointImpl transportNext() - { - return _transportNext; - } - - EndpointImpl transportPrev() - { - return _transportPrev; - } - - void setNext(EndpointImpl next) - { - _next = next; - } - - void setPrev(EndpointImpl prev) - { - _prev = prev; - } - - - public void destroy() - { - if(_next != null) - { - _next._prev = _prev; - } - if(_prev != null) - { - _prev._next = _next; - } - } - - void setTransportNext(EndpointImpl transportNext) - { - _transportNext = transportNext; - } - - void setTransportPrev(EndpointImpl transportPrevious) - { - _transportPrev = transportPrevious; - } - - EndpointImpl getPrev() - { - return _prev; - } - - EndpointImpl getNext() - { - return _next; - } -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/engine/src/org/apache/qpid/proton/engine/impl/EndpointSelectionSequence.java ---------------------------------------------------------------------- diff --git a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/EndpointSelectionSequence.java b/proton-j/engine/src/org/apache/qpid/proton/engine/impl/EndpointSelectionSequence.java deleted file mode 100644 index ee866ca..0000000 --- a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/EndpointSelectionSequence.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.engine.impl; - -import org.apache.qpid.proton.engine.Endpoint; -import org.apache.qpid.proton.engine.EndpointState; -import org.apache.qpid.proton.engine.Sequence; - -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -public class EndpointSelectionSequence<E extends Endpoint> extends SelectiveSequence<E> -{ - private final EnumSet<EndpointState> _local; - private final EnumSet<EndpointState> _remote; - - public EndpointSelectionSequence(EnumSet<EndpointState> local, EnumSet<EndpointState> remote, - List<? extends E> endpoints) - { - this(local, remote, endpoints.iterator()); - } - - public EndpointSelectionSequence(EnumSet<EndpointState> local, EnumSet<EndpointState> remote, - Iterator<? extends E> iterator) - { - this(local, remote, new IteratorSequence<E>(iterator)); - } - - public EndpointSelectionSequence(EnumSet<EndpointState> local, EnumSet<EndpointState> remote, Sequence<E> endpoints) - { - super(endpoints); - _local = local; - _remote = remote; - } - - - protected boolean select(E next) - { - return (_local == null || _local.contains(next.getLocalState())) - && (_remote == null || _remote.contains(next.getRemoteState())); - } - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/engine/src/org/apache/qpid/proton/engine/impl/FrameParser.java ---------------------------------------------------------------------- diff --git a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/FrameParser.java b/proton-j/engine/src/org/apache/qpid/proton/engine/impl/FrameParser.java deleted file mode 100644 index 3d8346f..0000000 --- a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/FrameParser.java +++ /dev/null @@ -1,305 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.engine.impl; - -import org.apache.qpid.proton.codec.DecodeException; -import org.apache.qpid.proton.codec.DecoderImpl; -import org.apache.qpid.proton.codec.EncoderImpl; -import org.apache.qpid.proton.engine.EndpointError; -import org.apache.qpid.proton.type.AMQPDefinedTypes; -import org.apache.qpid.proton.type.Binary; -import org.apache.qpid.proton.type.transport.FrameBody; - -import java.nio.ByteBuffer; -import java.util.Formatter; - -class FrameParser -{ - private final FrameBody.FrameBodyHandler<Integer> _frameBodyHandler; - - - public static final byte[] HEADER = new byte[8]; - - private EndpointError _localError; - - static - { - HEADER[0] = (byte) 'A'; - HEADER[1] = (byte) 'M'; - HEADER[2] = (byte) 'Q'; - HEADER[3] = (byte) 'P'; - HEADER[4] = 0; - HEADER[5] = 1; - HEADER[6] = 0; - HEADER[7] = 0; - } - - enum State - { - SIZE_0, - SIZE_1, - SIZE_2, - SIZE_3, - PRE_PARSE, - BUFFERING, - PARSING, - ERROR - } - - private State _state = State.SIZE_0; - private int _size; - - private ByteBuffer _buffer; - - private DecoderImpl _decoder = new DecoderImpl(); - private EncoderImpl _encoder = new EncoderImpl(_decoder); - - { - AMQPDefinedTypes.registerAllTypes(_decoder); - } - private int _ignore = 8; - - - FrameParser(FrameBody.FrameBodyHandler<Integer> frameBodyHandler) - { - _frameBodyHandler = frameBodyHandler; - } - - public int input(byte[] bytes, int offset, int length) - { - EndpointError frameParsingError = null; - int size = _size; - State state = _state; - ByteBuffer oldIn = null; - if(_ignore != 0) - { - if(length > _ignore) - { - offset+=_ignore; - length -= _ignore; - - _ignore = 0; - } - else - { - _ignore-=length; - return length; - } - } - - ByteBuffer in = ByteBuffer.wrap(bytes, offset, length); - - while(in.hasRemaining() && state != State.ERROR) - { - switch(state) - { - case SIZE_0: - if(in.remaining() >= 4) - { - size = in.getInt(); - state = State.PRE_PARSE; - break; - } - else - { - size = (in.get() << 24) & 0xFF000000; - if(!in.hasRemaining()) - { - state = State.SIZE_1; - break; - } - } - case SIZE_1: - size |= (in.get() << 16) & 0xFF0000; - if(!in.hasRemaining()) - { - state = State.SIZE_2; - break; - } - case SIZE_2: - size |= (in.get() << 8) & 0xFF00; - if(!in.hasRemaining()) - { - state = State.SIZE_3; - break; - } - case SIZE_3: - size |= in.get() & 0xFF; - state = State.PRE_PARSE; - - case PRE_PARSE: - ; - if(size < 8) - { - frameParsingError = createFramingError("specified frame size %d smaller than minimum frame header " - + "size %d", - _size, 8); - state = State.ERROR; - break; - } - - - if(in.remaining() < size-4) - { - _buffer = ByteBuffer.allocate(size-4); - _buffer.put(in); - state = State.BUFFERING; - break; - } - case BUFFERING: - if(_buffer != null) - { - if(in.remaining() < _buffer.remaining()) - { - _buffer.put(in); - break; - } - else - { - ByteBuffer dup = in.duplicate(); - dup.limit(dup.position()+_buffer.remaining()); - int i = _buffer.remaining(); - int d = dup.remaining(); - in.position(in.position()+_buffer.remaining()); - _buffer.put(dup); - oldIn = in; - _buffer.flip(); - in = _buffer; - state = State.PARSING; - } - } - - case PARSING: - - int dataOffset = (in.get() << 2) & 0x3FF; - - if(dataOffset < 8) - { - frameParsingError = createFramingError("specified frame data offset %d smaller than minimum frame header size %d", dataOffset, 8); - state = State.ERROR; - break; - } - else if(dataOffset > size) - { - frameParsingError = createFramingError("specified frame data offset %d larger than the frame size %d", dataOffset, _size); - state = State.ERROR; - break; - } - - // type - - int type = in.get() & 0xFF; - int channel = in.getShort() & 0xFF; - - if(type != 0) - { - frameParsingError = createFramingError("unknown frame type: %d", type); - state = State.ERROR; - break; - } - - if(dataOffset!=8) - { - in.position(in.position()+dataOffset-8); - } - - // oldIn null iff not working on duplicated buffer - if(oldIn == null) - { - oldIn = in; - in = in.duplicate(); - final int endPos = in.position() + size - dataOffset; - in.limit(endPos); - oldIn.position(endPos); - - } - - try - { - _decoder.setByteBuffer(in); - Object val = _decoder.readObject(); - - Binary payload; - - if(in.hasRemaining()) - { - byte[] payloadBytes = new byte[in.remaining()]; - in.get(payloadBytes); - payload = new Binary(payloadBytes); - } - else - { - payload = null; - } - - if(val instanceof FrameBody) - { - FrameBody frameBody = (FrameBody) val; - frameBody.invoke(_frameBodyHandler, payload,channel); - - } - else - { - // TODO - error - } - reset(); - in = oldIn; - oldIn = null; - _buffer = null; - state = State.SIZE_0; - break; - - - } - catch (DecodeException ex) - { - state = State.ERROR; - frameParsingError = createFramingError(ex.getMessage()); - } - } - - } - - _state = state; - _size = size; - - _localError = frameParsingError; - - return _state == State.ERROR ? -1 : length; - } - - private void reset() - { - _size = 0; - _state = State.SIZE_0; - } - - - private EndpointError createFramingError(String description, Object... args) - { - Formatter formatter = new Formatter(); - formatter.format(description, args); - System.out.println(formatter.toString()); - return null; //TODO. - } - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/engine/src/org/apache/qpid/proton/engine/impl/IteratorSequence.java ---------------------------------------------------------------------- diff --git a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/IteratorSequence.java b/proton-j/engine/src/org/apache/qpid/proton/engine/impl/IteratorSequence.java deleted file mode 100644 index d6c52cc..0000000 --- a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/IteratorSequence.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.engine.impl; - -import org.apache.qpid.proton.engine.Sequence; - -import java.util.Collection; -import java.util.Iterator; - -public class IteratorSequence<E> implements Sequence<E> -{ - private final Iterator<? extends E> _iterator; - - public IteratorSequence(Collection<? extends E> collection) - { - this(collection.iterator()); - } - - - public IteratorSequence(Iterator<? extends E> iterator) - { - _iterator = iterator; - } - - public E next() - { - if(_iterator.hasNext()) - { - return _iterator.next(); - } - return null; - } -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/engine/src/org/apache/qpid/proton/engine/impl/LinkImpl.java ---------------------------------------------------------------------- diff --git a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/LinkImpl.java b/proton-j/engine/src/org/apache/qpid/proton/engine/impl/LinkImpl.java deleted file mode 100644 index e161b17..0000000 --- a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/LinkImpl.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine.impl; - -import org.apache.qpid.proton.engine.Link; - -public abstract class LinkImpl extends EndpointImpl implements Link -{ - - private final SessionImpl _session; - - DeliveryImpl _head; - DeliveryImpl _tail; - DeliveryImpl _current; - private String _name; - private String _localSourceAddress; - private String _remoteSourceAddress; - private String _localTargetAddress; - private String _remoteTargetAddress; - - - public LinkImpl(SessionImpl session, String name) - { - _session = session; - _name = name; - } - - - public void open() - { - super.open(); - modified(); - } - - public void close() - { - super.close(); - modified(); - } - - String getName() - { - return _name; - } - - - - public DeliveryImpl delivery(byte[] tag, int offset, int length) - { - DeliveryImpl delivery = new DeliveryImpl(tag, this, _tail); - if(_tail == null) - { - _head = delivery; - } - _tail = delivery; - if(_current == null) - { - _current = delivery; - } - getConnectionImpl().workUpdate(delivery); - return delivery; - } - - public void destroy() - { - super.destroy(); - _session.getConnectionImpl().removeEndpoint(this); - //TODO. - } - - public void remove(DeliveryImpl delivery) - { - if(_head == delivery) - { - _head = delivery.getLinkNext(); - } - if(_tail == delivery) - { - _tail = delivery.getLinkPrevious(); - } - if(_current == delivery) - { - // TODO - what??? - } - } - - public DeliveryImpl current() - { - return _current; - } - - public boolean advance() - { - if(_current != null ) - { - DeliveryImpl oldCurrent = _current; - _current = _current.getLinkNext(); - getConnectionImpl().workUpdate(oldCurrent); - - if(_current != null) - { - getConnectionImpl().workUpdate(_current); - } - return true; - } - else - { - return false; - } - - } - - @Override - protected ConnectionImpl getConnectionImpl() - { - return _session.getConnectionImpl(); - } - - SessionImpl getSession() - { - return _session; - } - - public String getRemoteSourceAddress() - { - return _remoteSourceAddress; - } - - void setRemoteSourceAddress(String sourceAddress) - { - _remoteSourceAddress = sourceAddress; - } - - public String getRemoteTargetAddress() - { - return _remoteTargetAddress; - } - - void setRemoteTargetAddress(String targetAddress) - { - _remoteTargetAddress = targetAddress; - } - - String getLocalSourceAddress() - { - return _localSourceAddress; - } - - public void setLocalSourceAddress(String localSourceAddress) - { - // TODO - should be an error if local state is ACTIVE - _localSourceAddress = localSourceAddress; - modified(); - } - - String getLocalTargetAddress() - { - return _localTargetAddress; - } - - public void setLocalTargetAddress(String localTargetAddress) - { - // TODO - should be an error if local state is ACTIVE - _localTargetAddress = localTargetAddress; - modified(); - } - - abstract TransportLink getTransportLink(); - - abstract boolean workUpdate(DeliveryImpl delivery); -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/engine/src/org/apache/qpid/proton/engine/impl/ReceiverImpl.java ---------------------------------------------------------------------- diff --git a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/ReceiverImpl.java b/proton-j/engine/src/org/apache/qpid/proton/engine/impl/ReceiverImpl.java deleted file mode 100644 index ffa8055..0000000 --- a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/ReceiverImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine.impl; - -import org.apache.qpid.proton.engine.Delivery; -import org.apache.qpid.proton.engine.Receiver; -import org.apache.qpid.proton.engine.Sequence; - -public class ReceiverImpl extends LinkImpl implements Receiver -{ - private int _credits; - private TransportReceiver _transportReceiver; - - public ReceiverImpl(SessionImpl session, String name) - { - super(session, name); - } - - public void flow(final int credits) - { - modified(); - _credits += credits; - } - - int getCredits() - { - return _credits; - } - - int clearCredits() - { - int credits = _credits; - _credits = 0; - return credits; - } - - - public int recv(final byte[] bytes, int offset, int size) - { - return _current.recv(bytes, offset, size); - } - - public Sequence<Delivery> unsettled() - { - return null; //TODO. - } - - public void destroy() - { - super.destroy(); - //TODO. - } - - boolean hasIncoming() - { - return false; //TODO - Implement - } - - void setTransportLink(TransportReceiver transportReceiver) - { - _transportReceiver = transportReceiver; - } - - @Override - TransportReceiver getTransportLink() - { - return _transportReceiver; - } - - @Override - boolean workUpdate(DeliveryImpl delivery) - { - return (delivery == current()); - } -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/engine/src/org/apache/qpid/proton/engine/impl/SelectiveSequence.java ---------------------------------------------------------------------- diff --git a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/SelectiveSequence.java b/proton-j/engine/src/org/apache/qpid/proton/engine/impl/SelectiveSequence.java deleted file mode 100644 index ab48e02..0000000 --- a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/SelectiveSequence.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.engine.impl; - -import org.apache.qpid.proton.engine.Sequence; - -import java.util.Collection; -import java.util.Iterator; - -abstract class SelectiveSequence<E> implements Sequence<E> -{ - private final Sequence<E> _sequence; - - SelectiveSequence(Collection<E> collection) - { - this(collection.iterator()); - } - - SelectiveSequence(Iterator<E> iterator) - { - this(new IteratorSequence<E>(iterator)); - } - - - SelectiveSequence(Sequence<E> sequence) - { - _sequence = sequence; - } - - public E next() - { - E next; - while((next = _sequence.next())!= null) - { - if(select(next)) - { - return next; - } - } - return null; - } - - abstract protected boolean select(E next); - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/engine/src/org/apache/qpid/proton/engine/impl/SenderImpl.java ---------------------------------------------------------------------- diff --git a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/SenderImpl.java b/proton-j/engine/src/org/apache/qpid/proton/engine/impl/SenderImpl.java deleted file mode 100644 index 9f21661..0000000 --- a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/SenderImpl.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine.impl; - -import org.apache.qpid.proton.engine.Delivery; -import org.apache.qpid.proton.engine.Sender; -import org.apache.qpid.proton.engine.Sequence; - -public class SenderImpl extends LinkImpl implements Sender -{ - private int _credit; - private int _offered; - private TransportSender _transportLink; - - public SenderImpl(SessionImpl session, String name) - { - super(session, name); - } - - public void offer(final int credits) - { - _offered = credits; - } - - public int send(final byte[] bytes, int offset, int length) - { - //TODO. - return 0; - } - - public void abort() - { - //TODO. - } - - public Sequence<Delivery> unsettled() - { - return null; //TODO. - } - - - public void destroy() - { - super.destroy(); - //TODO. - } - - @Override - public boolean advance() - { - DeliveryImpl delivery = current(); - boolean advance = hasCredit() && super.advance(); - if(advance && _offered > 0) - { - _offered--; - _credit--; - } - if(advance) - { - delivery.addToTransportWorkList(); - } - return advance; - } - - private boolean hasCredit() - { - return _credit > 0; - } - - boolean hasOfferedCredits() - { - return _offered > 0; - } - - @Override - TransportSender getTransportLink() - { - return _transportLink; - } - - void setTransportLink(TransportSender transportLink) - { - _transportLink = transportLink; - } - - public void setCredit(int credit) - { - _credit = credit; - } - - @Override - boolean workUpdate(DeliveryImpl delivery) - { - return (delivery == current()) && hasCredit(); - } -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/engine/src/org/apache/qpid/proton/engine/impl/SessionImpl.java ---------------------------------------------------------------------- diff --git a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/SessionImpl.java b/proton-j/engine/src/org/apache/qpid/proton/engine/impl/SessionImpl.java deleted file mode 100644 index b0430b8..0000000 --- a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/SessionImpl.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine.impl; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import org.apache.qpid.proton.engine.EndpointState; -import org.apache.qpid.proton.engine.Sequence; -import org.apache.qpid.proton.engine.Session; - -public class SessionImpl extends EndpointImpl implements Session -{ - private final ConnectionImpl _connection; - - private List<SenderImpl> _senders = new ArrayList<SenderImpl>(); - private List<ReceiverImpl> _receivers = new ArrayList<ReceiverImpl>(); - private TransportSession _transportSession; - - - public SessionImpl(ConnectionImpl connection) - { - _connection = connection; - } - - public void open() - { - super.open(); - modified(); - } - - public void close() - { - - super.close(); - modified(); - } - - public SenderImpl sender(String name) - { - SenderImpl sender = new SenderImpl(this, name); - _senders.add(sender); - _connection.addEndpoint(sender); - return sender; - } - - public ReceiverImpl receiver(String name) - { - ReceiverImpl receiver = new ReceiverImpl(this, name); - _receivers.add(receiver); - _connection.addEndpoint(receiver); - return receiver; - } - - public Sequence<LinkImpl> endpoints(final EnumSet<EndpointState> local, final EnumSet<EndpointState> remote) - { - IteratorSequence<LinkImpl> senderSequence = new IteratorSequence<LinkImpl>(_senders.iterator()); - IteratorSequence<LinkImpl> receiverSequence = new IteratorSequence<LinkImpl>(_receivers.iterator()); - - return new EndpointSelectionSequence<LinkImpl>(local, remote, - new ConcatenatedSequence<LinkImpl>(senderSequence,receiverSequence)); - } - - @Override - protected ConnectionImpl getConnectionImpl() - { - return _connection; - } - - public void destroy() - { - super.destroy(); - _connection.removeEndpoint(this); - for(SenderImpl sender : _senders) - { - sender.destroy(); - } - _senders.clear(); - for(ReceiverImpl receiver : _receivers) - { - receiver.destroy(); - } - _receivers.clear(); - } - - TransportSession getTransportSession() - { - return _transportSession; - } - - void setTransportSession(TransportSession transportSession) - { - _transportSession = transportSession; - } -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/engine/src/org/apache/qpid/proton/engine/impl/TransportDelivery.java ---------------------------------------------------------------------- diff --git a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/TransportDelivery.java b/proton-j/engine/src/org/apache/qpid/proton/engine/impl/TransportDelivery.java deleted file mode 100644 index 1b364ff..0000000 --- a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/TransportDelivery.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.engine.impl; - -import org.apache.qpid.proton.engine.Delivery; -import org.apache.qpid.proton.type.UnsignedInteger; - -public class TransportDelivery -{ - private UnsignedInteger _deliveryId; - private Delivery _delivery; - private TransportLink _transportLink; - - public TransportDelivery(UnsignedInteger currentDeliveryId, Delivery delivery, TransportLink transportLink) - { - _deliveryId = currentDeliveryId; - _delivery = delivery; - _transportLink = transportLink; - } - - public UnsignedInteger getDeliveryId() - { - return _deliveryId; - } - - public TransportLink getTransportLink() - { - return _transportLink; - } -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/engine/src/org/apache/qpid/proton/engine/impl/TransportFactory.java ---------------------------------------------------------------------- diff --git a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/TransportFactory.java b/proton-j/engine/src/org/apache/qpid/proton/engine/impl/TransportFactory.java deleted file mode 100644 index ddf2170..0000000 --- a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/TransportFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine.impl; - -import org.apache.qpid.proton.engine.Connection; -import org.apache.qpid.proton.engine.Transport; - -public abstract class TransportFactory -{ - public abstract Transport transport(Connection conn); - - public static TransportFactory getDefaultTransportFactory() - { - return new TransportFactoryImpl(); - } -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e57c2a52/proton-j/engine/src/org/apache/qpid/proton/engine/impl/TransportFactoryImpl.java ---------------------------------------------------------------------- diff --git a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/TransportFactoryImpl.java b/proton-j/engine/src/org/apache/qpid/proton/engine/impl/TransportFactoryImpl.java deleted file mode 100644 index 5ec14f6..0000000 --- a/proton-j/engine/src/org/apache/qpid/proton/engine/impl/TransportFactoryImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine.impl; - -import org.apache.qpid.proton.engine.Connection; -import org.apache.qpid.proton.engine.Transport; - -class TransportFactoryImpl extends TransportFactory -{ - public Transport transport(Connection c) - { - return new TransportImpl(c); - } - -} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
