/** * <p> * Get the {@link ExampleBag} set in the active {@link BaggageContext} carried by the current thread. If no baggage is being * carried by the current thread, or if there is no ExampleBag in it, then this method returns {@code null}. * </p> * * <p> * To get ExampleBag from a specific Baggage instance, use {@link #getFrom(BaggageContext)}. * </p> * * @return the ExampleBag being carried in the {@link BaggageContext} of the current thread, or {@code null} * if none is being carried. The returned instance maybe be modified and modifications will be reflected in * the baggage. */ public static ExampleBag get() { Bag bag = BDLContextProvider.get(ActiveBaggage.peek(), Handler.registration()); if (bag instanceof ExampleBag) { return (ExampleBag) bag; } else { return null; } }
/** * <p> * Get the {@link XTraceBaggage} set in {@code baggage}. If {@code baggage} has no XTraceBaggage set then * this method returns null. * </p> * * <p> * This method does <b>not</b> affect the Baggage being carried by the current thread. To get XTraceBaggage * from the current thread's Baggage, use {@link #get()}. * </p> * * @param baggage A baggage instance to get the {@link XTraceBaggage} from * @return the {@link XTraceBaggage} instance being carried in {@code baggage}, or {@code null} if none is being carried. * The returned instance can be modified, and modifications will be reflected in the baggage. */ public static XTraceBaggage getFrom(BaggageContext baggage) { Bag bag = BDLContextProvider.get(baggage, Handler.registration()); if (bag instanceof XTraceBaggage) { return (XTraceBaggage) bag; } else if (bag != null) { Handler.checkRegistration(); } return null; }
/** * <p> * Get the {@link XTraceBaggage} set in the active {@link BaggageContext} carried by the current thread. If no baggage is being * carried by the current thread, or if there is no XTraceBaggage in it, then this method returns {@code null}. * </p> * * <p> * To get XTraceBaggage from a specific Baggage instance, use {@link #getFrom(BaggageContext)}. * </p> * * @return the XTraceBaggage being carried in the {@link BaggageContext} of the current thread, or {@code null} * if none is being carried. The returned instance maybe be modified and modifications will be reflected in * the baggage. */ public static XTraceBaggage get() { Bag bag = BDLContextProvider.get(ActiveBaggage.peek(), Handler.registration()); if (bag instanceof XTraceBaggage) { return (XTraceBaggage) bag; } else { return null; } }
/** * <p> * Get the {@link FonsecaBag} set in the active {@link BaggageContext} carried by the current thread. If no baggage is being * carried by the current thread, or if there is no FonsecaBag in it, then this method returns {@code null}. * </p> * * <p> * To get FonsecaBag from a specific Baggage instance, use {@link #getFrom(BaggageContext)}. * </p> * * @return the FonsecaBag being carried in the {@link BaggageContext} of the current thread, or {@code null} * if none is being carried. The returned instance maybe be modified and modifications will be reflected in * the baggage. */ public static FonsecaBag get() { Bag bag = BDLContextProvider.get(ActiveBaggage.peek(), Handler.registration()); if (bag instanceof FonsecaBag) { return (FonsecaBag) bag; } else { return null; } }
/** * <p> * Get the {@link SimpleBag} set in the active {@link BaggageContext} carried by the current thread. If no baggage is being * carried by the current thread, or if there is no SimpleBag in it, then this method returns {@code null}. * </p> * * <p> * To get SimpleBag from a specific Baggage instance, use {@link #getFrom(BaggageContext)}. * </p> * * @return the SimpleBag being carried in the {@link BaggageContext} of the current thread, or {@code null} * if none is being carried. The returned instance maybe be modified and modifications will be reflected in * the baggage. */ public static SimpleBag get() { Bag bag = BDLContextProvider.get(ActiveBaggage.peek(), Handler.registration()); if (bag instanceof SimpleBag) { return (SimpleBag) bag; } else { return null; } }
/** * <p> * Get the {@link SimpleBag2} set in the active {@link BaggageContext} carried by the current thread. If no baggage is being * carried by the current thread, or if there is no SimpleBag2 in it, then this method returns {@code null}. * </p> * * <p> * To get SimpleBag2 from a specific Baggage instance, use {@link #getFrom(BaggageContext)}. * </p> * * @return the SimpleBag2 being carried in the {@link BaggageContext} of the current thread, or {@code null} * if none is being carried. The returned instance maybe be modified and modifications will be reflected in * the baggage. */ public static SimpleBag2 get() { Bag bag = BDLContextProvider.get(ActiveBaggage.peek(), Handler.registration()); if (bag instanceof SimpleBag2) { return (SimpleBag2) bag; } else { return null; } }
/** * <p> * Get the {@link ExampleBag} set in {@code baggage}. If {@code baggage} has no ExampleBag set then * this method returns null. * </p> * * <p> * This method does <b>not</b> affect the Baggage being carried by the current thread. To get ExampleBag * from the current thread's Baggage, use {@link #get()}. * </p> * * @param baggage A baggage instance to get the {@link ExampleBag} from * @return the {@link ExampleBag} instance being carried in {@code baggage}, or {@code null} if none is being carried. * The returned instance can be modified, and modifications will be reflected in the baggage. */ public static ExampleBag getFrom(BaggageContext baggage) { Bag bag = BDLContextProvider.get(baggage, Handler.registration()); if (bag instanceof ExampleBag) { return (ExampleBag) bag; } else if (bag != null) { Handler.checkRegistration(); } return null; }
/** * <p> * Get the {@link SimpleBag} set in {@code baggage}. If {@code baggage} has no SimpleBag set then * this method returns null. * </p> * * <p> * This method does <b>not</b> affect the Baggage being carried by the current thread. To get SimpleBag * from the current thread's Baggage, use {@link #get()}. * </p> * * @param baggage A baggage instance to get the {@link SimpleBag} from * @return the {@link SimpleBag} instance being carried in {@code baggage}, or {@code null} if none is being carried. * The returned instance can be modified, and modifications will be reflected in the baggage. */ public static SimpleBag getFrom(BaggageContext baggage) { Bag bag = BDLContextProvider.get(baggage, Handler.registration()); if (bag instanceof SimpleBag) { return (SimpleBag) bag; } else if (bag != null) { Handler.checkRegistration(); } return null; }
/** * <p> * Get the {@link SimpleBag2} set in {@code baggage}. If {@code baggage} has no SimpleBag2 set then * this method returns null. * </p> * * <p> * This method does <b>not</b> affect the Baggage being carried by the current thread. To get SimpleBag2 * from the current thread's Baggage, use {@link #get()}. * </p> * * @param baggage A baggage instance to get the {@link SimpleBag2} from * @return the {@link SimpleBag2} instance being carried in {@code baggage}, or {@code null} if none is being carried. * The returned instance can be modified, and modifications will be reflected in the baggage. */ public static SimpleBag2 getFrom(BaggageContext baggage) { Bag bag = BDLContextProvider.get(baggage, Handler.registration()); if (bag instanceof SimpleBag2) { return (SimpleBag2) bag; } else if (bag != null) { Handler.checkRegistration(); } return null; }
/** * <p> * Get the {@link FonsecaBag} set in {@code baggage}. If {@code baggage} has no FonsecaBag set then * this method returns null. * </p> * * <p> * This method does <b>not</b> affect the Baggage being carried by the current thread. To get FonsecaBag * from the current thread's Baggage, use {@link #get()}. * </p> * * @param baggage A baggage instance to get the {@link FonsecaBag} from * @return the {@link FonsecaBag} instance being carried in {@code baggage}, or {@code null} if none is being carried. * The returned instance can be modified, and modifications will be reflected in the baggage. */ public static FonsecaBag getFrom(BaggageContext baggage) { Bag bag = BDLContextProvider.get(baggage, Handler.registration()); if (bag instanceof FonsecaBag) { return (FonsecaBag) bag; } else if (bag != null) { Handler.checkRegistration(); } return null; }