A tool which enhances your pojo, powered by java-agent.

Overview

pojo-agent

A tool which enhances your pojo, powered by java-agent.

maven

<dependency>
  <groupId>io.vproxygroupId>
  <artifactId>pojo-agent-apiartifactId>
  <version>1.0.0version>
dependency>

gradle

implementation group: 'io.vproxy', name: 'pojo-agent-api', version: '1.0.0'

current supported functions

  • Helps you know that a setter is invoked or not.

build

./gradlew clean jar

The agent is in build/libs/pojo-agent.jar.
You can also get the pre-built agent in the release pages.

how to use

Works on java 11, 17, and kotlin.

step 1

Add @Pojo annotation on you pojo:

@Pojo
public class MyEntity {
  private String id;
  // getters ...
  // setters ...
}

or you can use data class if you are using kotlin:

@Pojo
data class MyEntity(
  var id: String = ""
)
// getters and setters are generated by kotlin compiler

step 2

Add @PojoCaller on the method which requires enhancement:

@PojoCaller
public void updateMyEntity(MyEntity entity) {
  // ...
}

step 3

Use PojoAgent helper class in the @PojoCaller functions:

// check whether a field is set
PojoAgent.fieldIsSet(entity.getId())

// unset the field
PojoAgent.unsetField(entity.getId())
// then you will get `false` from `fieldIsSet` call after calling `unsetField`
// However note that the value of this property will not be modified, you can still get correct result from `getId()`

step 4

Add -javaagent:${path-to-pojo-agent.jar} to your java command.

If you are using java 17, you may need to add extra arguments: --add-opens java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED --add-opens java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED

sample

The sample code is in ./sample/src/main/

Run:

  • ./gradlew clean sample
  • ./gradlew clean ktsample

to see the output.

You might also like...

An agent to hotpatch the log4j RCE from CVE-2021-44228.

Log4jHotPatch This is a tool which injects a Java agent into a running JVM process. The agent will attempt to patch the lookup() method of all loaded

Dec 13, 2022

A manager tool to categorize game assets such as images and sounds/music. The tool enables you to tag these files, so that finding them by tags allows fast searches.

A manager tool to categorize game assets such as images and sounds/music. The tool enables you to tag these files, so that finding them by tags allows fast searches.

BtAssetManager This application allows you to easily categorize large amounts of image and sound files. You can apply tags to each individual file to

Sep 15, 2022

A fast and reliable Java micro-library which chooses the sorting algorithm that best fits your needs and sorts the parameter.

A fast and reliable Java micro-library which chooses the sorting algorithm that best fits your needs and sorts the parameter.

Feb 19, 2022

Z2Laser - a simple Java-based tool to convert Z movements in your G-Code files to Laser on or off commands

Z2Laser - a simple Java-based tool to convert Z movements in your G-Code files to Laser on or off commands

Feb 20, 2022

Simple and lightweight application which is checking status of your web services and send a notification if it is down.

rose-uptimer Simple and lightweight application which is checking status of your web services and send a notification if it is down. Example configura

Sep 25, 2022

A simple FizzBuzz playing program which will count up to a number of your choice.

FizzBuzz A simple program which plays FizzBuzz up to a number of your choice. For those who don't know how FizzBuzz works, you count up from 1, but: E

Sep 15, 2022

WordleCompanion - A tool to help you determine those hard-to-guess words while doing your daily Wordle puzzles.

A tool to help you determine those hard-to-guess words while doing your daily Wordle puzzles. How it works Enter the 5-letter word you

Jan 22, 2022

Create your Java crypto trading bot in minutes. Our Spring boot starter takes care of exchange connections, accounts, orders, trades, and positions so you can focus on building your strategies.

Create your Java crypto trading bot in minutes. Our Spring boot starter takes care of exchange connections, accounts, orders, trades, and positions so you can focus on building your strategies.

Quick Start | Documentation | Discord | Twitter Create and run your java crypto trading bot in minutes Our Spring boot starter takes care of exchange

Jan 3, 2023

Generate a dynamic PAC script that will route traffic to your Burp proxy only if it matches the scope defined in your Burp target.

Generate a dynamic PAC script that will route traffic to your Burp proxy only if it matches the scope defined in your Burp target.

Burp PAC Server This Burp Extension generates a dynamic Proxy Auto-Configuration (PAC) script that will route traffic to your Burp proxy only if it ma

Jun 13, 2022
Owner
K.G. Wang
K.G. Wang
A smart personal voice assistant powered by Alan AI. Enjoy hands free application that can manage daily tasks

Todogenix A smart personal voice assistant using Alan AI. Intro Todogenix is a personal assistant app powered by Alan AI that helps store and manage o

Venu Sai Madisetti 8 Mar 15, 2022
🍿 Movies and TV Shows streaming App powered by TMDb

Cineapp A Movie / TV-Show streaming app with elegant UI Implementations The Movie Database (TMDb) Room Database Retrofit - for networking Glide - for

vandit vasa 17 Dec 1, 2022
Java agent that enables class reloading in a running JVM

Welcome to Spring-Loaded What is Spring Loaded? Spring Loaded is a JVM agent for reloading class file changes whilst a JVM is running. It transforms c

Spring 2.7k Dec 26, 2022
A Java agent that disables platform features you don't use, before an attacker uses them against you.

aegis4j Avoid the NEXT Log4Shell vulnerability! The Java platform has accrued a number of features over the years. Some of these features are no longe

Daniel Gredler 14 Jan 11, 2022
A java apm agent based on skywalking and open-telemetry.

Hermes是提供给Java应用使用的Apm解决方案。 基于Apache Skywalking Agent Core. 复用了对于byte-buddy的封装 复用了logging日志模块 复用了config配置 复用了BootService 做了一些优化定制 Tracing协议基于Open-tele

道君 6 Dec 7, 2021
A tool ot export, analyse and visualize your transactions, rewards and commissions of your liquidity mining pools or DEX transactions.

VisualTrans A tool ot export, analyse and visualize your transactions, rewards and commissions of your liquidity mining pools or DEX transactions. Doc

Tongjian Cui 15 Mar 11, 2022
Kong agent for Apache SkyWalking

Apache SkyWalking Kong Agent SkyWalking Kong agent built on SkyWalking Nginx Lua agent to trace Kong API gateway for Apache SkyWalking APM. Usage Inst

The Apache Software Foundation 23 Nov 20, 2022
An example spring boot app to try out with a Parca Agent deployment.

Spring boot example This repo is an example for how a Java application can be profiled with Parca Agent. First deploy Parca and Parca Agent as usual,

Parca 1 Mar 9, 2022
Deploys an agent to fix CVE-2021-44228 (Log4j RCE vulnerability) in a running JVM process

-- This repository has been archived -- Further development of this tool will continue at corretto/hotpatch-for-apache-log4j2. Thanks for sharing, com

Volker Simonis 108 Dec 23, 2021