# bhatti/plexservices architecture

> Architecture diagram of the GitHub repository bhatti/plexservices, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhatti/plexservices
- Repository: https://github.com/bhatti/plexservices

## Overview

##### Main Components

a) Core Service Layer:
- ServiceRegistry (Central component)
- Request/Response Handlers
- Service Configuration Management
- Security Authorization Layer

b) Protocol Handlers:
- HTTP/REST (Netty & Servlet-based)
- WebSocket
- JMS (Java Message Service)
- EventBus (Internal messaging)

c) Bridge Components:
- Web-to-JMS Bridge
- EventBus-to-JMS Bridge

d) Encoding/Decoding Layer:
- JSON Codec
- XML Codec
- Text Codec

e) Support Components:
- Validation Framework
- Interceptor Chain
- Metrics & Monitoring
- FSM (Finite State Machine)

**[Client Layer]**

- ▼
**[Protocol Layer]**

**[Bridge Layer]**

**[Core Service Layer]**

**[Support Layer]**

##### Detailed Component Breakdown

**[Client Applications] ═══════════════════════════════════**

- ▼                    ▼                  ▼
- [HTTP/REST]        [WebSocket]            [JMS]

- ┐      ┌─────┘            ┌─────┘
- ▼      ▼                  ▼
- [Web-to-JMS Bridge]      [EventBus-to-JMS Bridge]

- ┐    ┌─────┘
- ▼    ▼
- [Service Registry]

- ┌──────────────────┼──────────────────┐
- ▼                  ▼                  ▼
**[Request Handlers]  [Security Layer]  [Service Config]**

- ┼──────────────────┘
- ▼
- [Support Services]
- ┌─────────────┬────────────┬─────────────┐
- ▼             ▼            ▼             ▼
**[Validation] [Interceptors] [Metrics]      [FSM]**

##### Additional Details

a) Component Descriptions:
- Brief descriptions for each major component
- Supported protocols and formats
- Configuration options

b) Flow Indicators:
- Primary request flow
- Alternative paths
- Synchronous vs asynchronous operations

c) Integration Points:
- External system connections
- Security boundaries
- Monitoring points

##### Deployment View

- Service containers
- JMS providers
- Load balancers
- Monitoring systems

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style definitions
    classDef client fill:#f2f2f2,stroke:#333
    classDef protocol fill:#90EE90,stroke:#333
    classDef bridge fill:#FFA500,stroke:#333
    classDef core fill:#87CEEB,stroke:#333
    classDef support fill:#FFD700,stroke:#333
    classDef codec fill:#DDA0DD,stroke:#333

    %% Client Layer
    Client["Client Applications"]:::client

    %% Protocol Layer
    subgraph Protocols
        HTTP["HTTP/REST"]:::protocol
        WS["WebSocket"]:::protocol
        JMS["JMS"]:::protocol
    end

    %% Bridge Layer
    WebJMSBridge["Web-to-JMS Bridge"]:::bridge
    EBJMSBridge["EventBus-to-JMS Bridge"]:::bridge

    %% Core Layer
    subgraph Core
        ServiceRegistry["Service Registry"]:::core
        ReqHandlers["Request Handlers"]:::core
        Security["Security Authorizer"]:::core
        ServiceConfig["Service Configuration"]:::core
    end

    %% Support Layer
    subgraph Support
        Validation["Validation Framework"]:::support
        Interceptors["Interceptor Chain"]:::support
        Metrics["Metrics & Monitoring"]:::support
        FSM["Finite State Machine"]:::support
    end

    %% Codec Layer
    subgraph Codecs
        JsonCodec["JSON Codec"]:::codec
        XmlCodec["XML Codec"]:::codec
        TextCodec["Text Codec"]:::codec
    end

    %% Connections
    Client --> HTTP & WS & JMS
    HTTP & WS --> WebJMSBridge
    JMS --> EBJMSBridge
    WebJMSBridge & EBJMSBridge --> ServiceRegistry
    ServiceRegistry --> ReqHandlers & Security & ServiceConfig
    ReqHandlers & Security & ServiceConfig --> Validation & Interceptors & Metrics & FSM
    ReqHandlers --> JsonCodec & XmlCodec & TextCodec

    %% Click events
    click HTTP "https://github.com/bhatti/PlexServices/tree/master/plexsvc-framework/src/main/java/com/plexobject/http/"
    click WS "https://github.com/bhatti/PlexServices/tree/master/plexsvc-framework/src/main/java/com/plexobject/handler/ws/"
    click JMS "https://github.com/bhatti/PlexServices/tree/master/plexsvc-framework/src/main/java/com/plexobject/jms/"
    click WebJMSBridge "https://github.com/bhatti/PlexServices/blob/master/plexsvc-framework/src/main/java/com/plexobject/bridge/web/WebToJmsBridge.java"
    click EBJMSBridge "https://github.com/bhatti/PlexServices/blob/master/plexsvc-framework/src/main/java/com/plexobject/bridge/eb/EventBusToJmsBridge.java"
    click ServiceRegistry "https://github.com/bhatti/PlexServices/blob/master/plexsvc-framework/src/main/java/com/plexobject/service/ServiceRegistry.java"
    click ReqHandlers "https://github.com/bhatti/PlexServices/blob/master/plexsvc-framework/src/main/java/com/plexobject/handler/RequestHandler.java"
    click Security "https://github.com/bhatti/PlexServices/blob/master/plexsvc-framework/src/main/java/com/plexobject/security/SecurityAuthorizer.java"
    click Validation "https://github.com/bhatti/PlexServices/tree/master/plexsvc-framework/src/main/java/com/plexobject/validation/"
    click Interceptors "https://github.com/bhatti/PlexServices/blob/master/plexsvc-framework/src/main/java/com/plexobject/service/Interceptor.java"
    click Metrics "https://github.com/bhatti/PlexServices/tree/master/plexsvc-framework/src/main/java/com/plexobject/metrics/"
    click FSM "https://github.com/bhatti/PlexServices/blob/master/plexsvc-framework/src/main/java/com/plexobject/fsm/FSM.java"
    click JsonCodec "https://github.com/bhatti/PlexServices/blob/master/plexsvc-framework/src/main/java/com/plexobject/encode/json/JsonObjectCodec.java"
    click XmlCodec "https://github.com/bhatti/PlexServices/blob/master/plexsvc-framework/src/main/java/com/plexobject/encode/xml/XmlObjectCodec.java"
    click TextCodec "https://github.com/bhatti/PlexServices/blob/master/plexsvc-framework/src/main/java/com/plexobject/encode/text/TextObjectCodec.java"

    %% Legend
    subgraph Legend
        L1["Client Layer"]:::client
        L2["Protocol Layer"]:::protocol
        L3["Bridge Layer"]:::bridge
        L4["Core Layer"]:::core
        L5["Support Layer"]:::support
        L6["Codec Layer"]:::codec
    end
```
