Coder Social home page Coder Social logo

java-was's Introduction

Java WAS 만들어 보기

| 2024 우아한 테크캠프 프로젝트 WAS

| 프로젝트 기간: 2024.07.01 ~ 2024.07.19

| 우아한 테크캠프 7기 이지표

서버 (server 패키지)

server.core

server.core

  • Server는 port번호와 threadPoolSize, basePackage(스캔할 Handler가 있는 패키지)를 입력받는다.

  • ThreadPool에게 threadPoolSize를 넘겨주고, ThreadPool은 쓰레드 풀을 생성한다.

  • Port는 port번호가 유효한지, 검증하고, 포트 번호를 가지고 있다.

  • ConnectionAcceptor는 Port를 넘겨받고, 해당 포트 번호로 소켓을 생성한다.

  • HandlerScanner는 Server가 넘겨준 basePackage를 기준으로 스캔을하고, 사용자가 설정한 Handler List를 RequestDispatcher에게 넘겨준다.

  • 서버는 HttpConnectionProcessor에게 클라이언트 소켓과, requestDispatcher를 넘겨주고, 이를 실행한다.

server.template

server.template

  • 사용자가 TemplateEngine에 template 이름과 data를 전달한다.

  • TemplateEngine이 templates 폴더에서 해당 template를 읽어온다.

  • TemplateEngine이 읽어온 template를 TemplateParser에 전달한다.

  • TemplateParser가 template를 Element 단위로 재귀적으로 분석한니다.

  • TemplateParser가 분석 결과인 root Element를 TemplateEngine에 반환한다.

  • TemplateEngine이 root Element와 data를 TemplateRenderer에 전달한다.

  • TemplateRenderer가 data를 적용하여 최종 화면을 생성한다.

  • TemplateRenderer가 생성된 화면을 TemplateEngine에 반환한다.

  • 마지막으로, TemplateEngine이 최종 결과를 사용자에게 반환한다.

server.session

server.session

  • 세션 생성: 사용자가 SessionManager에 새 세션 생성을 요청한다.

  • 세션 조회: 사용자가 sessionId로 세션을 요청하고, SessionManager가 유효성을 검사한다.

  • 만료된 경우: 세션을 무효화하고 null을 반환한다.

  • 유효한 경우: 마지막 접근 시간을 갱신하고 세션을 반환한다.

  • 세션 사용: 사용자가 Session 객체의 메서드들을 직접 호출하여 데이터를 관리한다.

  • 세션 무효화: 사용자가 SessionManager에 세션 무효화를 요청한다.

  • 만료된 세션 정리: SessionManager가 주기적으로 만료된 세션들을 정리한다.

데이터베이스 (database 패키지)

database

  • 사용자가 SQL 문을 SQLParser에 전달한다.

  • SQLParser가 SQL을 파싱하고 적절한 Statement 객체를 생성한다.

  • Statement 객체가 CsvDataBaseEngine에서 실행된다.

  • CsvDataBaseEngine은 Statement 타입에 따라 다르게 동작한다:

    • CreateTableStatement: 새 CSV 파일을 생성하고 컬럼 정보를 추가한다.
    • InsertStatement: CSV 파일에 새 레코드를 추가한다.
    • SelectStatement: CSV 파일의 데이터를 읽고, WHERE 조건을 확인한 후 ResultSet에 결과를 추가한다.
  • 실행 결과가 사용자에게 반환된다.

테크 스펙

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.