All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.pkts.packet.PacketFactory Maven / Gradle / Ivy

There is a newer version: 3.0.10
Show newest version
/**
 * 
 */
package io.pkts.packet;

import io.pkts.packet.impl.TransportPacketFactoryImpl;
import io.pkts.protocol.Protocol;

/**
 * You can't write java without a bunch of factories! :-)
 * 
 * @author [email protected]
 */
public final class PacketFactory {

    private static final PacketFactory instance = new PacketFactory();

    private static final TransportPacketFactory transportFactory = new TransportPacketFactoryImpl(instance);

    public static PacketFactory getInstance() {
        return instance;
    }

    /**
     * Private constructor
     */
    private PacketFactory() {
        // left empty intentionally
    }

    /**
     * Obtain a reference to the {@link TransportPacketFactory} through which
     * you can create any arbitrary {@link Protocol#UDP} and
     * {@link Protocol#TCP} packets.
     * 
     * @return
     */
    public TransportPacketFactory getTransportFactory() {
        return transportFactory;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy